Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 08:46 AM
Laphan
Guest
 
Posts: n/a
Default OLE DB Connection Problems

Hi Guys

One of you kindly confirmed what the true OLE DB syntax is for an ASP > ADO[color=blue]
> Access DB with password, but I'm struggling to parse this in my ASP page.[/color]

FYR, I have it as follows:

strDSN="""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat"",""admin"","""""

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Mode = 3
oConn.Connectionstring = strDSN
oConn.Open

But when I execute the above I get:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name too long

The path name for the DB is spot on, as it works with the ODBC variant, but
I think it has something to do with my 200 quote marks!

Can u help??

Rgds

Laphan


  #2  
Old July 19th, 2005, 08:46 AM
John Blessing
Guest
 
Posts: n/a
Default Re: OLE DB Connection Problems

"Laphan" <news@FrozenMoles.co.uk> wrote in message
news:blpsh4$dur$1@titan.btinternet.com...[color=blue]
> Hi Guys
>
> One of you kindly confirmed what the true OLE DB syntax is for an ASP >[/color]
ADO[color=blue][color=green]
> > Access DB with password, but I'm struggling to parse this in my ASP[/color][/color]
page.[color=blue]
>
> FYR, I have it as follows:
>
> strDSN="""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
> Password=kitkat"",""admin"","""""
>
> Set oConn = Server.CreateObject("ADODB.Connection")
> oConn.Mode = 3
> oConn.Connectionstring = strDSN
> oConn.Open
>
> But when I execute the above I get:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
> [Microsoft][ODBC Driver Manager] Data source name too long
>
> The path name for the DB is spot on, as it works with the ODBC variant,[/color]
but[color=blue]
> I think it has something to do with my 200 quote marks!
>
> Can u help??
>
> Rgds
>
> Laphan
>[/color]


Get rid of the quotes, you don't need them.

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.free-helpdesk.com - Completely free help desk software !
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook


  #3  
Old July 19th, 2005, 08:46 AM
Robbie
Guest
 
Posts: n/a
Default Re: OLE DB Connection Problems

"John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message news:<nZ_fb.7561$QH3.3766@newsfep4-winn.server.ntli.net>...[color=blue]
> "Laphan" <news@FrozenMoles.co.uk> wrote in message
> news:blpsh4$dur$1@titan.btinternet.com...[color=green]
> > Hi Guys
> >
> > One of you kindly confirmed what the true OLE DB syntax is for an ASP >[/color]
> ADO[color=green][color=darkred]
> > > Access DB with password, but I'm struggling to parse this in my ASP[/color][/color]
> page.[color=green]
> >
> > FYR, I have it as follows:
> >
> > strDSN="""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> > Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
> > Password=kitkat"",""admin"","""""
> >
> > Set oConn = Server.CreateObject("ADODB.Connection")
> > oConn.Mode = 3
> > oConn.Connectionstring = strDSN
> > oConn.Open
> >
> > But when I execute the above I get:
> >
> > Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> >
> > [Microsoft][ODBC Driver Manager] Data source name too long
> >
> > The path name for the DB is spot on, as it works with the ODBC variant,[/color]
> but[color=green]
> > I think it has something to do with my 200 quote marks!
> >
> > Can u help??
> >
> > Rgds
> >
> > Laphan
> >[/color]
>
>
> Get rid of the quotes, you don't need them.[/color]

Hi John

Thanks for your prompt assistance.

As per your suggestion, I changed it to the following:

strDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat,admin,"

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Mode = 3
oConn.Connectionstring = strDSN
oConn.Open

But now I get the following error message:

Microsoft JET Database Engine error '80040e4d'
Not a valid password.

If I change the strDSN back to:

strDSN="DBQ=" & Server.Mappath("mydb.mdb") & ";Driver={Microsoft
Access Driver (*.mdb)}; userID=Admin; pwd=kitkat"

It works fine.

I want to use OLEDB so what am I doing wrong??

Rgds

Laphan
  #4  
Old July 19th, 2005, 08:47 AM
Bob Barrows
Guest
 
Posts: n/a
Default Re: OLE DB Connection Problems

www.able-consulting.com/ado_conn.htm

more below

Robbie wrote:[color=blue]
> "John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message
> news:<nZ_fb.7561$QH3.3766@newsfep4-winn.server.ntli.net>...[color=green]
>> "Laphan" <news@FrozenMoles.co.uk> wrote in message
>> news:blpsh4$dur$1@titan.btinternet.com...[/color]
> As per your suggestion, I changed it to the following:
>
> strDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
> Password=kitkat,admin,"[/color]

How could this possibly work? I assume the password is "kitkat", not
"kitkat,admin".

Unless you have a workgroup-secured database, you do NOT need to supply a
user name. You only need to supply a password if the database is
password-protected.

Bob Barrows


  #5  
Old July 19th, 2005, 08:48 AM
Robbie
Guest
 
Posts: n/a
Default Re: OLE DB Connection Problems

"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message news:<##0BGsAjDHA.888@TK2MSFTNGP09.phx.gbl>...[color=blue]
> www.able-consulting.com/ado_conn.htm
>
> more below
>
> Robbie wrote:[color=green]
> > "John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message
> > news:<nZ_fb.7561$QH3.3766@newsfep4-winn.server.ntli.net>...[color=darkred]
> >> "Laphan" <news@FrozenMoles.co.uk> wrote in message
> >> news:blpsh4$dur$1@titan.btinternet.com...[/color]
> > As per your suggestion, I changed it to the following:
> >
> > strDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> > Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database
> > Password=kitkat,admin,"[/color]
>
> How could this possibly work? I assume the password is "kitkat", not
> "kitkat,admin".
>
> Unless you have a workgroup-secured database, you do NOT need to supply a
> user name. You only need to supply a password if the database is
> password-protected.
>
> Bob Barrows[/color]

Dear Bob

Thanks for your reply.

John (the other poster) kindly sent me some MS stuff on this so I
copied and used the following:

strDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.Mappath("mydb.mdb") & ";Jet OLEDB:Database Password=kitkat"

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Connectionstring = strDSN
oConn.Open

However when I run this I get the following error message:

Microsoft JET Database Engine error '80040e14'
Syntax error in parameters clause. Make sure the parameter exists and
that you typed its value correctly.

If I use the above path and password in a normal ODBC connection it
works fine.

Can u tell what I am doing wrong?

Rgds

Robbie
  #6  
Old July 19th, 2005, 08:48 AM
Bob Barrows
Guest
 
Posts: n/a
Default Re: OLE DB Connection Problems

Robbie wrote:[color=blue]
>
> John (the other poster) kindly sent me some MS stuff on this so I
> copied and used the following:
>
> strDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> Server.Mappath("mydb.mdb") & ";Jet OLEDB:Database Password=kitkat"
>
> Set oConn = Server.CreateObject("ADODB.Connection")
> oConn.Connectionstring = strDSN
> oConn.Open
>
> However when I run this I get the following error message:
>
> Microsoft JET Database Engine error '80040e14'
> Syntax error in parameters clause. Make sure the parameter exists and
> that you typed its value correctly.
>
> If I use the above path and password in a normal ODBC connection it
> works fine.
>[/color]
This error has nothing to do with your connection. The connection has been
established: otherwise you would not be getting an error from the JET
Database Engine. It's a problem with something you are doing later on in the
code. Why don't you show us the relevant code?

"Parameters clause" sounds like a problem in a query. You're not using any
reserved words as column or parameter names are you? See here for a list of
reserved words:
http://www.aspfaq.com/show.asp?id=2080

If you have made the mistake of using a reserved word, then change the name
of the column or parameter. If you absolutely cannot change the name, then
you need to surround it with brackets [] in order to use it in a query
called from ADO.

Bob Barrows


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles