473,699 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="""Provi der=Microsoft.J et.OLEDB.4.0;Da ta Source=" &
Server.MapPath( "mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat "",""admin"","" """

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Mode = 3
oConn.Connectio nstring = 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 10843
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message
news:bl******** **@titan.btinte rnet.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="""Provi der=Microsoft.J et.OLEDB.4.0;Da ta Source=" &
Server.MapPath( "mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat "",""admin"","" """

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Mode = 3
oConn.Connectio nstring = 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**T HIS**LbeHelpdes k.com> wrote in message news:<nZ******* **********@news fep4-winn.server.ntl i.net>...
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message
news:bl******** **@titan.btinte rnet.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="""Provi der=Microsoft.J et.OLEDB.4.0;Da ta Source=" &
Server.MapPath( "mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat "",""admin"","" """

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Mode = 3
oConn.Connectio nstring = 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="Provide r=Microsoft.Jet .OLEDB.4.0;Data Source=" &
Server.MapPath( "mydb.mdb") & ";Jet OLEDB:Database
Password=kitkat ,admin,"

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Mode = 3
oConn.Connectio nstring = 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={Micro soft
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**T HIS**LbeHelpdes k.com> wrote in message
news:<nZ******* **********@news fep4-winn.server.ntl i.net>...
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message
news:bl******** **@titan.btinte rnet.com...

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

strDSN="Provide r=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,adm in".

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******@NOyah oo.SPAMcom> wrote in message news:<##******* ******@TK2MSFTN GP09.phx.gbl>.. .
www.able-consulting.com/ado_conn.htm

more below

Robbie wrote:
"John Blessing" <jb@**REMOVE**T HIS**LbeHelpdes k.com> wrote in message
news:<nZ******* **********@news fep4-winn.server.ntl i.net>...
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message
news:bl******** **@titan.btinte rnet.com...

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

strDSN="Provide r=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,adm in".

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="Provide r=Microsoft.Jet .OLEDB.4.0;Data Source=" &
Server.Mappath( "mydb.mdb") & ";Jet OLEDB:Database Password=kitkat "

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Connectio nstring = 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="Provide r=Microsoft.Jet .OLEDB.4.0;Data Source=" &
Server.Mappath( "mydb.mdb") & ";Jet OLEDB:Database Password=kitkat "

Set oConn = Server.CreateOb ject("ADODB.Con nection")
oConn.Connectio nstring = 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
4715
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= Server.CreateObject("ADODB.Connection") dbConn.Open "DSN=somedsn; UID=someuser; PWD=somepassword" With the ASP running on an IIS 5 server, using the Oracle 8 driver to connect to an Oracle 9 database, there are no connection problems, and
8
12112
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). It has worked relatively well for some time, but recently I'm often encountering errors when trying to fetch the data. I am pretty sure that this is because of a poor wireless connection since I'm also having some problems e.g. copying files...
9
17026
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 access any of the Oracle tables on another machine but now I am having problems. Unfortunately, I don't remember the correct syntax for the ODBC connect string and I am hoping that is my whole problem. I am trying to connect to an Oracle 9...
2
2452
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 open, because I begin to receive error message indicating that the system can not open a connection and I should check my connection pool, with me being the only one on the server, this should not really be a problem. I am not sure why I do not...
10
2507
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 private shared DB as System.Data.SqlClient.SqlConnection
7
2937
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 some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for something. When I run the same control from a windows application it connects right away and works...
26
16504
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 Win2K3/IIS6.0), do we still need this patch? 2) Does it specifically solve only this error: The underlying connection was closed. An unexpected error
4
14632
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 inefficient if every request for data wil incurr the overhead of creating a connection to the db. While on the subject of pooling - does any one know (when using PHP in "server side scripting") if scripts are launched as seperate processes
17
2375
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, this method doesn't close it, it just returns the datareader. The calling code uses the datareader and then just lets it drop out of scope, to be picked up by the garbage collector. Is this a problem? A friend of mine suggested to me that not...
4
8282
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 access those records. The timeout error occurs after 60 seconds. Many times the user has given up and used ctrl-alt-del to end task thinking their computer has locked up. I suppose I could change the default timeout from 60 seconds down to 30...
0
8706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8633
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9055
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8902
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7787
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4392
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2366
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.