Ask a Question related to ASP Database, Design and Development.
-
Tim. D #1
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
-
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... -
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... -
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 -
Internal Server Error 500 When Creating Conn.
I'm having the same problem. It seems there's no easy solution for this one... -
.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... -
Aaron [SQL Server MVP] #2
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
-
Tjé Da Mo #3
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
-
joker #4
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
-
Tjé Da Mo #5
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
-
joker #6
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



Reply With Quote

