1 Replies - 1554 Views - Last Post: 13 May 2009 - 08:13 PM Rate Topic: -----

#1 ann_may10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-May 09

cannot connect to access 2007

Posted 13 May 2009 - 07:48 PM

 Option Explicit

Public conConnect As ADODB.Connection
Public rsEquipment As Recordset
Public rsDescription As Recordset
Public rsLocation As Recordset
Public rsReturnSlip As Recordset

Public Function connect()

Set conConnect = New ADODB.Connection
Set rsEquipment = New ADODB.Recordset
Set rsDescription = New ADODB.Recordset
Set rsLocation = New ADODB.Recordset
Set rsReturnSlip = New Recordset

conConnect.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=darsaccess.accdb"



End Function



hello everyone i would like to ask what's wrong with my codes i cannot connect it to microsoft access 2007 i'm using visual basic 6. The error says "Run-time error "-21474672 (80004005) Could not find file path..

Is This A Good Question/Topic? 0
  • +

Replies To: cannot connect to access 2007

#2 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: cannot connect to access 2007

Posted 13 May 2009 - 08:13 PM

Your...
conConnect.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=darsaccess.accdb"



Data Source=darsaccess.accdb"

is not a fully qualified path. Something like...

Data Source=C:\darsaccess.accdb"

or whatever is the path to the database you are trying to open should work.

Good Luck
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1