5 Replies - 2113 Views - Last Post: 17 March 2009 - 06:30 PM Rate Topic: -----

#1 dex619  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-March 09

Trying to link to a password protected database (MS Access)

Posted 16 March 2009 - 07:59 PM

First of all, no i am not trying to hack a database :crazy: , i am trying to link to a database, created in MS Access, and have the user log into it, but i still get an error saying

Quote

an unhandled expression of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

here is the code i'm using to input the password and username from a text box
 conn = ("Provider=MICROSOFT.JET.OLEDB.4.0; Data Source= ***path***/data.mdb; User ID='" & txt1.text & "';Password='" & txt2.text & "'")


By the way the database is password protected by access.

Is This A Good Question/Topic? 0
  • +

Replies To: Trying to link to a password protected database (MS Access)

#2 krum110487  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 291
  • Joined: 07-February 09

Re: Trying to link to a password protected database (MS Access)

Posted 16 March 2009 - 08:13 PM

What version of access is it?
Was This Post Helpful? 0
  • +
  • -

#3 dex619  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-March 09

Re: Trying to link to a password protected database (MS Access)

Posted 16 March 2009 - 09:16 PM

View Postkrum110487, on 16 Mar, 2009 - 07:13 PM, said:

What version of access is it?

MS Access 2003
Was This Post Helpful? 0
  • +
  • -

#4 eworm  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 64
  • Joined: 17-March 09

Re: Trying to link to a password protected database (MS Access)

Posted 17 March 2009 - 12:09 PM

Try removing the single quotes (') around your textbox entries? I don't believe you need them in a connection string.

 conn = ("Provider=MICROSOFT.JET.OLEDB.4.0; Data Source= ***path***/data.mdb; User ID=" & txt1.text & ";Password=" & txt2.text)


This post has been edited by eworm: 17 March 2009 - 12:11 PM

Was This Post Helpful? 0
  • +
  • -

#5 krum110487  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 291
  • Joined: 07-February 09

Re: Trying to link to a password protected database (MS Access)

Posted 17 March 2009 - 12:35 PM

I KNOW IT hahah, after your password add a semicolon!!

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;


http://www.connectio...ings.com/access
Was This Post Helpful? 0
  • +
  • -

#6 dex619  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-March 09

Re: Trying to link to a password protected database (MS Access)

Posted 17 March 2009 - 06:30 PM

thanx m8, by the way i edited your code, and this works
conn = ("Provider=MICROSOFT.JET.OLEDB.4.0; Data Source= ***path***/data.mdb; User ID='" & txt1.text & "'; JET OLEDB: Database Password='" & txt2.text & "';")

This post has been edited by dex619: 17 March 2009 - 07:07 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1