Click here to Skip to main content
12,507,674 members (55,989 online)
Rate this:
 
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
ssskp32226
Updated 9-Oct-12 4:05am
Tim Corey113K
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100