actually : www.connectionstringS.com
Main Topics
Browse All TopicsIt's been about a year since I last used ASP and for the life of me I can't figure out what's wrong. Perhaps there's more than one problem.
HELP!
Conn = "Driver={SQLServer};Server
Set rsTest = server.createObject("adodb
sqlTest = "select * from tblUsers where active = 1"
rsTest.open, sqlTest, Conn, 3,3
Gives me a
Provider error '80020005'
Type mismatch.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
actually : www.connectionstringS.com
Dim DSN, DatabaseUsername, DatabasePassword, DatabaseName, DatabaseHost, Conn, rsTest
DatabaseUsername = "<whatever>"
DatabasePassword = "<whatever>"
DatabaseName = "<whatever>"
DatabaseHost = "<whatever>"
DSN = "Provider=SQLOLEDB;" & _
"User ID=" & DatabaseUsername & ";" & _
"Password=" & DatabasePassword & ";" & _
"Initial Catalog=" & DatabaseName & ";" & _
"Data Source=" & DatabaseHost & ";" & _
"Persist Security Info=True;" & _
"Connect Timeout=20"
Set Conn = Server.CreateObject("ADODB
Conn.Open DSN
Set rsTest = server.createObject("adodb
sqlTest = "select * from tblUsers where active = 1"
rsTest.open, sqlTest, Conn, 3,3
try this:
Dim DSN, DatabaseUsername, DatabasePassword, DatabaseName, DatabaseHost, Conn, rsTest
DatabaseUsername = "<whatever>"
DatabasePassword = "<whatever>"
DatabaseName = "<whatever>"
DatabaseHost = "<whatever>"
DSN = "Provider=SQLOLEDB;" & _
"User ID=" & DatabaseUsername & ";" & _
"Password=" & DatabasePassword & ";" & _
"Initial Catalog=" & DatabaseName & ";" & _
"Data Source=" & DatabaseHost & ";" & _
"Persist Security Info=True;" & _
"Connect Timeout=20"
Set Conn = Server.CreateObject("ADODB
Conn.Open DSN
Set rsTest = Conn.Execute("select * from tblUsers where active = 1")
>>but am I crazy thinking I used to do this without an explicit connection object?<<
That is possible, you just have to code it right :)
Conn = "Driver={SQLServer};Server
Set rsTest = server.createObject("adodb
sqlTest = "select * from tblUsers where active = 1"
rsTest.open sqlTest, Conn, 3, 3
OK,
the data type of active is int.
**************
Conn = "Driver={SQLServer};Server
Set rsTest = server.createObject("adodb
sqlTest = "select * from tblUsers where active = 1"
rsTest.open sqlTest, Conn, 3, 3
still gets me an error as does my original code without the additional comma. I assume the problem is in the connection string?
**************
Conn = "Driver={SQLServer};Server
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/db/conn.asp, line 18
BUT this works in inviser's method....
DatabaseUsername = "sa"
DatabasePassword = "password"
DatabaseName = "lni"
DatabaseHost = "phweb\LNIPHX"
******************
To be honest I'm not sure that I don't like inviser's method better. I've just always used the other method (like acperkins example) and the fact that I can't make it work is driving me nuts.
There should be a space in between "SQL" and "Server". Although you will get better performance using the OLEDB driver rather than the ODBC:
Conn = "Driver={SQL Server};Server=phweb\LNIPH
Conn = "Provider=SQLOLEDB.1;Serve
Business Accounts
Answer for Membership
by: aprestoPosted on 2006-07-24 at 15:09:59ID: 17171938
silly question, but i take it you are filling in the blanks:
=(Local);D atabase=sa ;Uid=sa;Pw d=letmein; "
Conn = "Driver={SQLServer};Server
for reference
www.connectionstring.com