PDA

View Full Version : Problem connecting to a database using custom connection string


Kamran
11-30-2006, 06:32 PM
Hi there

I'm having trouble conencting to a database stored on my web server. I'm trying to do this within dreamweaver using the custom string connection feature (since I have to create a dsnless connection).
The script language I am using is ASP.

The ASP code that my web host has provided is below. Can someone tell me what information I have to enter into the connection string field in order for to connect to the database?
Thanks
Dim oConn, sConnection
Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\sites\Single??\UserName\database\data.md b;" & _
"Persist Security Info=False"
oConn.Open(sConnection)

oConn.Close
Set oConn = nothing

davidj
11-30-2006, 08:52 PM
try this


set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:/sites/Single??/UserName/database/data.mdb"


welcome to the forum kamran

Kamran
12-01-2006, 06:38 PM
try this


set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:/sites/Single??/UserName/database/data.mdb"


welcome to the forum kamran
Thanks for the welcome David, and for the tip. But how would you put all that into the string field? It only allows for the string to go on one line.

davidj
12-01-2006, 09:16 PM
just stick it on 1 line