conn.open problem on client, not on server

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default conn.open problem on client, not on server

    I'm struggling with this problem waaaaay to long...

    i want to generate a letter when a button is clicked on my page. Ms
    Word should be opened and you should be able to see the document
    filling up as the code executes...

    this is the script i wrote:

    <script language="vbscript">
    dim objword

    Sub OpenDoc()

    dim Objword
    dim rs, conn, Sql, Rs2, Sql2, Nummer
    set Conn = createobject("ADODB.Connection")
    set Rs = createobject("ADODB.Recordset")
    set Rs2 = createobject("ADODB.Recordset")

    set objword = createobject("Word.application")
    objword.visible = true
    objword.documents.add "C:\Diensthoofd_hartrev.dot"
    objdoc = objword.activedocument

    '
    conn.Open "DSN=TAFTEN;UID=Administrator;PWD=test"
    'Sql = "Select * from onderzoeken where onderzoeksnummer =
    '040607-3EF'"

    'rs.Source = sql
    'rs.ActiveConnection = conn
    'rs.Open

    'objword.selection.typeparagraph
    'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Aan Prof. Dr. Seppen"
    'objword.selection.typeparagraph
    'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Cardiologie"
    'objword.selection.typeparagraph
    'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Alhier De joskens 185"
    'objword.selection.typeparagraph
    'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "9000 Gavere"
    'objword.selection.typeparagraph
    'objword.selection.typeparagraph
    'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Gavere, 16 juli 2004"
    'objword.selection.typeparagraph
    'objword.selection.typeparagraph
    'objword.selection.typetext "Geachte Collega,"

    on the server this works perfectly... but when i request the page from
    a client-machine on the same domain and clicked the button, a
    worddocument was opened but further nothing happened. on the bottom of
    my page a yellow !-sign tells me '"error on page", nothing more... by
    putting the rest of my code between ' i know that the error is in the
    line: "conn.Open "DSN=TAFTEN;UID=Administrator;PWD=secret""
    Tim. D Guest

  2. Similar Questions and Discussions

    1. Flash Webcam client <-> client (not client <-> server<-> client)
      Dear Flash Team, supporter and regular mortals (Like myself) I am currently running a IRC chat with mostly webclients connected. We currently offer...
    2. java client and .NET server problem
      Hi, I'm writing a java client for .NET server. I'm using Java and the Apache Axis API. When I send a soap request I get back the following...
    3. Internal Server Error 500 When Creating Conn.
      wot OS r u using? Have you downloaded the patch from macromedia for windows XP SP2? try that. Jay
    4. Internal Server Error 500 When Creating Conn.
      I'm having the same problem. It seems there's no easy solution for this one...
    5. .net Impersonate with integrated authentication client server problem
      Hi, I build a asp.net web application to update user accounts in Active Directory (AD). This application works fine on my test server when I acces...
  3. #2

    Default Re: conn.open problem on client, not on server

    You are mixing client-side and server-side concepts. I have never seen
    functional client-side code that connects to a database through a DSN. Is
    the user actually sitting on the server where the DSN/ASP pages are? If so,
    then ASP is probably not your best option here. If not, then how do you
    verify that each user has that DSN and has the appropriate word and access
    files on each machine?

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "Tim. D" <tim.demoor@uzgent.be> wrote in message
    news:9db436e4.0408040623.72e06437@posting.google.c om...
    > I'm struggling with this problem waaaaay to long...
    >
    > i want to generate a letter when a button is clicked on my page. Ms
    > Word should be opened and you should be able to see the document
    > filling up as the code executes...
    >
    > this is the script i wrote:
    >
    > <script language="vbscript">
    > dim objword
    >
    > Sub OpenDoc()
    >
    > dim Objword
    > dim rs, conn, Sql, Rs2, Sql2, Nummer
    > set Conn = createobject("ADODB.Connection")
    > set Rs = createobject("ADODB.Recordset")
    > set Rs2 = createobject("ADODB.Recordset")
    >
    > set objword = createobject("Word.application")
    > objword.visible = true
    > objword.documents.add "C:\Diensthoofd_hartrev.dot"
    > objdoc = objword.activedocument
    >
    > '
    > conn.Open "DSN=TAFTEN;UID=Administrator;PWD=test"
    > 'Sql = "Select * from onderzoeken where onderzoeksnummer =
    > '040607-3EF'"
    >
    > 'rs.Source = sql
    > 'rs.ActiveConnection = conn
    > 'rs.Open
    >
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    > chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Aan Prof. Dr. Seppen"
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    > chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Cardiologie"
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    > chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Alhier De joskens 185"
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    > chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "9000 Gavere"
    > 'objword.selection.typeparagraph
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext chr(9) & chr(9) & chr(9) & chr(9) &
    > chr(9) & chr(9) & chr(9)& chr(9) & chr(9) & "Gavere, 16 juli 2004"
    > 'objword.selection.typeparagraph
    > 'objword.selection.typeparagraph
    > 'objword.selection.typetext "Geachte Collega,"
    >
    > on the server this works perfectly... but when i request the page from
    > a client-machine on the same domain and clicked the button, a
    > worddocument was opened but further nothing happened. on the bottom of
    > my page a yellow !-sign tells me '"error on page", nothing more... by
    > putting the rest of my code between ' i know that the error is in the
    > line: "conn.Open "DSN=TAFTEN;UID=Administrator;PWD=secret""

    Aaron [SQL Server MVP] Guest

  4. #3

    Default Re: conn.open problem on client, not on server



    i came up with this asp-page and client-side vbscript when i realized
    that server-side automation in asp.net is NOT a good idea... I was
    hoping the clientscript would enable the client to open word and connect
    to my (sql2000) DB, enabling me to generate the letter.

    I was programming on the servermachine and everything worked fine. When
    i first tried a to request the page from a client-machine (in the same
    intranet). The client opens the template (which is on all our
    computers) but then stops when i try to make the connection with my DSN.
    I have a working system DSN on my server that points to my sql database.

    i hope that this info makes my problem a little bit clearer.

    you said i was mixing client- and server-side concepts...

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Tjé Da Mo Guest

  5. #4

    Default Re: conn.open problem on client, not on server

    The DSN is being turned down by Microsoft according to
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/ado_deprecated_components.asp[/url]
    so I'd recommend against using it in your new project. A DSN is a
    server concept. In you idea you are using server side programing on a
    client machine, this is a major taboo. This is because the user may
    change your DSN and thus ruin the entire app you just made.

    Tjé Da Mo wrote:
    >
    > i came up with this asp-page and client-side vbscript when i realized
    > that server-side automation in asp.net is NOT a good idea... I was
    > hoping the clientscript would enable the client to open word and connect
    > to my (sql2000) DB, enabling me to generate the letter.
    >
    > I was programming on the servermachine and everything worked fine. When
    > i first tried a to request the page from a client-machine (in the same
    > intranet). The client opens the template (which is on all our
    > computers) but then stops when i try to make the connection with my DSN.
    > I have a working system DSN on my server that points to my sql database.
    >
    > i hope that this info makes my problem a little bit clearer.
    >
    > you said i was mixing client- and server-side concepts...
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    joker Guest

  6. #5

    Default Re: conn.open problem on client, not on server

    thanx for your reply again...
    i was able te to connect with the DSN but i will keep in mind what you
    said about the user changing the DSN... this could be a problem indeed
    :)

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Tjé Da Mo Guest

  7. #6

    Default Re: conn.open problem on client, not on server

    Don't forget that Microsoft has scheduled the use of ODBC (aka DSN) to
    be deprecated. This means that Microsoft believes that the use of DSN
    is no longer a good option. Thus I highly recommend against using it.

    I think you should redesign the project because of this fact.

    This site gives you some ideas on what you should be doing instead.

    [url]http://www.aspfaq.com/show.asp?id=2126[/url]

    It is the same site that linked over to the Deprecated Components of the
    MDAC.

    Tjé Da Mo wrote:
    > thanx for your reply again...
    > i was able te to connect with the DSN but i will keep in mind what you
    > said about the user changing the DSN... this could be a problem indeed
    > :)
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    joker Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139