Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 ASP vs. SQL
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

squall leonhart
Starting Member

4 Posts

Posted - 04/07/2006 :  07:32:39  Show Profile  Send squall leonhart a Yahoo! Message  Reply with Quote
I tried to connect asp with SQL Server but it doesn't work. This is my code:


conn = "Provider=SQLOLEDB.1;Data Source = "
+ Server.Mappath="/aspProductCatalog/database/aspProduct_Data.mdf"


var rs, rs2, cn, msg

cn = Server.CreateObject("ADODB.Connection");
rs = Server.CreateObject("ADODB.Recordset");
sqlstring = "Select * From Admin", cn);

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.
/aspProductCatalog/test.asp, line 13

* This is the first time I post topic, so maybe I make some mistakes, plz forgive me!

Edited by - squall leonhart on 04/07/2006 07:35:41

Flowing Fount of Yak Knowledge

2916 Posts

Posted - 04/07/2006 :  07:54:29  Show Profile  Reply with Quote
print the contents of CONN and see if the path is absolutely correct. is it possible the / should be \???
Go to Top of Page


United Kingdom
22859 Posts

Posted - 04/07/2006 :  07:58:11  Show Profile  Reply with Quote
Your connection string looks more like Access (which identifies a specific database file) rather than SQL Server (which identifies a Server and Database name).

See for examples

Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 04/07/2006 :  08:54:04  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Also, post your questions at relevent forums like Developer,etc. This is the forum to post workable scripts


Failing to plan is Planning to fail
Go to Top of Page

squall leonhart
Starting Member

4 Posts

Posted - 04/07/2006 :  21:02:23  Show Profile  Send squall leonhart a Yahoo! Message  Reply with Quote
Thanks all for the advice. I tried again.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000