|
 |
asp_databases thread: RE: connect to database on another server
Message #1 by BPETER377@a... on Mon, 17 Jun 2002 08:25:51 EDT
|
|
error is = [dbnetlib] connectionopen (parseconnectparams()). invalid
connection
On line = objconn.open strdblocation
Message #2 by "Bliven, Corinne" <Corinne.Bliven@o...> on Mon, 17 Jun 2002 08:28:11 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C215FA.72006130
Content-Type: text/plain;
charset="iso-8859-1"
It looks like you are using your connection object to connect to one
database and then the same object to connect to another. In order to do that
you must first close the first connection and then re-open it (with the
right provider of course) for the second. If you need to have the first
connection open then just use 2 connection objects.
Hope that helps
CNB
-----Original Message-----
From: BPETER377@a... [mailto:BPETER377@a...]
Sent: Monday, June 17, 2002 8:26 AM
To: ASP Databases
Subject: [asp_databases] RE: connect to database on another server
error is = [dbnetlib] connectionopen (parseconnectparams()). invalid
connection
On line = objconn.open strdblocation
Message #3 by "peter brown" <bpeter377@a...> on Mon, 17 Jun 2002 13:12:21
|
|
'This code returns an error, my problem is have the user
'enter a range of dates and a name to bring back all associated records
'anybody help?
<html>
<head>
<title>c04 User Data (Date Type) In SQL Response</title>
</head>
<body>
<h2>Chapter 4 - SQL for Recordsets</h2>
<p><font size="3" color="green">Try It Out #6 - User Data (Date Type) in
SQL Statements -
Response Page</font></p>
<%
varDOBStart = request.form("DOBStart")
varDOBEnd = request.form("DOBEnd")
dim oRSp,strdblocation,objconn
strdblocation = "C:\MSSQL7\BACKUP\callQ.mdf" ' this is for test, real
world = "provider=sqloledb;data source = servername;
' initial
catalog=databasename;" & "user id=??; password = ??????;"
Set objconn=server.createobject("ADODB.connection")
objconn.provider = "SQLOLEDB"
objconn.open strdblocation
Set oRSp=server.createobject("ADODB.recordset")
sqltext="Select * from callquality "
sqltext=sqltext & " WHERE dateofassessment between "
sqltext=sqltext & "#" & varDOBStart
sqltext=sqltext & "# and #" & varDOBEnd & "#;"
response.write "<hr>" & sqltext & "<hr>"
oRSp.open sqltext
response.write "<table border=1>"
do while NOT oRSp.EOF
response.write "<tr><td>" & oRSp("results") & "</td>"
response.write "<td>" & oRSp("advisorname") & "</td>"
response.write "<td>" & oRSp("dateofassessment") & "</td></tr>"
oRSp.MoveNext
Loop
response.write "</table>"
%>
</body>
</html>
Message #4 by "Meinken, Joe" <Joe.Meinken@q...> on Mon, 17 Jun 2002 07:05:47 -0500
|
|
What is the error and where is it in the code?
-----Original Message-----
From: peter brown [mailto:bpeter377@a...]
Sent: Monday, June 17, 2002 8:12 AM
To: ASP Databases
Subject: [asp_databases] connect to database on another server
'This code returns an error, my problem is have the user
'enter a range of dates and a name to bring back all associated records
'anybody help?
<html>
<head>
<title>c04 User Data (Date Type) In SQL Response</title>
</head>
<body>
<h2>Chapter 4 - SQL for Recordsets</h2>
<p><font size="3" color="green">Try It Out #6 - User Data (Date Type) in
SQL Statements -
Response Page</font></p>
<%
varDOBStart = request.form("DOBStart")
varDOBEnd = request.form("DOBEnd")
dim oRSp,strdblocation,objconn
strdblocation = "C:\MSSQL7\BACKUP\callQ.mdf" ' this is for test, real
world = "provider=sqloledb;data source = servername;
' initial
catalog=databasename;" & "user id=??; password = ??????;"
Set objconn=server.createobject("ADODB.connection")
objconn.provider = "SQLOLEDB"
objconn.open strdblocation
Set oRSp=server.createobject("ADODB.recordset")
sqltext="Select * from callquality "
sqltext=sqltext & " WHERE dateofassessment between "
sqltext=sqltext & "#" & varDOBStart
sqltext=sqltext & "# and #" & varDOBEnd & "#;"
response.write "<hr>" & sqltext & "<hr>"
oRSp.open sqltext
response.write "<table border=1>"
do while NOT oRSp.EOF
response.write "<tr><td>" & oRSp("results") & "</td>"
response.write "<td>" & oRSp("advisorname") & "</td>"
response.write "<td>" & oRSp("dateofassessment") & "</td></tr>"
oRSp.MoveNext
Loop
response.write "</table>"
%>
</body>
</html>
|
|
 |