dsn less syntax

S

shank

What's wrong with the syntax in this connection string?
It's a DSN less connection to an Access DB.
thanks!

<%
Set Conn = Server.CreateObject("ADODB.Connection")
MM_GenKAccess_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("authors.mdb") & ";" & _
Jet OLEDB:Database Password=48912; & _
Jet OLEDB:System database=" & Server.MapPath("system.mdw") & ";" & _
conn.open MM_GenKAccess_STRING
%>
 
A

Aaron [SQL Server MVP]

Well, you forgot to put some of your strings inside string delimiters, and
you had a trailing & _ that will likely cause problems. And stop letting
WISIWYG tools create stupid variable names for you! Try:



set conn = CreateObject("ADODB.Connection")

mdb = Server.MapPath("authors.mdb")
mdw = Server.MapPath("system.mdw")

connString = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & mdb & ";" & _
"Jet OLEDB:Database Password=48912;" & _
"Jet OLEDB:System database=" & mdw

conn.open connString
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top