|
-
Aug 4th, 2004, 08:26 AM
#1
Thread Starter
Addicted Member
conn.open problem
I'm stuggling 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:
Code:
<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 worked perfectly... but when i requested 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=test""
please help me, i'm getting desperate...
never argue with an idiot, he will bring you down to his level and will beat you through experience
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|