473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

OLE DB Connection Problems

Hi Guys

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


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
Jul 19 '05 #1
5 10833
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:bl**********@titan.btinternet.com...
Hi Guys

One of you kindly confirmed what the true OLE DB syntax is for an ASP > ADO
Access DB with password, but I'm struggling to parse this in my ASP

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

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
Jul 19 '05 #2
"John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message news:<nZ*****************@newsfep4-winn.server.ntli.net>...
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:bl**********@titan.btinternet.com...
Hi Guys

One of you kindly confirmed what the true OLE DB syntax is for an ASP >

ADO
Access DB with password, but I'm struggling to parse this in my ASP

page.

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

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


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
Jul 19 '05 #3
www.able-consulting.com/ado_conn.htm

more below

Robbie wrote:
"John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message
news:<nZ*****************@newsfep4-winn.server.ntli.net>...
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:bl**********@titan.btinternet.com...

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,"


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
Jul 19 '05 #4
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message news:<##*************@TK2MSFTNGP09.phx.gbl>...
www.able-consulting.com/ado_conn.htm

more below

Robbie wrote:
"John Blessing" <jb@**REMOVE**THIS**LbeHelpdesk.com> wrote in message
news:<nZ*****************@newsfep4-winn.server.ntli.net>...
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:bl**********@titan.btinternet.com...

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,"


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


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
Jul 19 '05 #5
Robbie wrote:

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.

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
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff Cooley | last post by:
Can anybody suggest what may be causing the following problem ? I have an ASP script that opens a connection to an Oracle database using a DSN connection string, such as : Set dbConn=...
8
by: Peter Larsson | last post by:
Hi there, I've recently developed a VBA-program in Excel that fetches and presents data from a distant Access database over a wireless peer-to-peer network (both computers running Win XP Pro)....
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
2
by: Jim Heavey | last post by:
How do I set up a Connection Pool? How can I look on the server and see how many connections are being used by my application? I am pretty sure that my application must be leaving connections...
10
by: Daniel Fernandes | last post by:
Hi there Let's say due to several reasons I have an ASP.Net application that has a database access class that stores a database connection in a shared member : public class dataaccess ...
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
4
by: Susan Baker | last post by:
PHP Newbie here - I apologize if any of my questions appear daft or obvious ... Does PHP (or maybe the web server - Apache in my case), support (database) connection pooling?. It seems terribly...
17
by: Alan Silver | last post by:
Hello, I have a generic method in a utility class that grabs an sqldatareader and returns it. Due to the fact that (AFAIK), you can't close the database connection before you've read the data,...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.