Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP
How do I establish a connection to sql in msfrontpage?
 
I have done this:
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 8-Oct-12 23:40pm
ssskp32151
Edited 9-Oct-12 4:05am
Tim Corey85.1K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid