Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I establish a connection to sql in msfrontpage?

I have done this:
VB
Dim Conn,objrs
Set Conn=server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider={SQL Server}; Data Source=dataserver;Initial Catalog=dbname; User ID=uid; Password=pswrd" 
Conn.open	
set objrs=Server.CreateObject("ADODB.Recordset")
strSQL="select field1 from table1"
objrs.open strSQL,Conn,3,3
response.write "test"

but it shows an error:
Error Type:
ADODB.Connection (0x800A0E7A)
Provider cannot be found. It may not be properly installed.
/iss/example.asp, line 12

What should I do?
Posted
Updated 9-Oct-12 4:05am
v2

1 solution

I see a couple things here. First, you are trying to use ADODB for your connection and yet you are using an OLEDB connection string. The difference is important. If I recall correctly, you should use OLEDB for Frontpage/Classic ASP connections. I'm not sure if it is because it doesn't support ADO or if it was something else. In any event, here is a site that will give you an example of how to connect to a SQL database:

http://www.4guysfromrolla.com/webtech/063099-1.shtml[^]

If you are wondering about different SQL connection strings, you can always go to http://www.connectionstrings.com/[^]. Just make sure you pick the right one for your situation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900