3 Replies - 1119 Views - Last Post: 09 October 2011 - 04:55 AM Rate Topic: -----

#1 MarshaR  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 08-October 11

Error: IndexOutOfRangeException

Posted 08 October 2011 - 05:39 AM

Hi,
I'm new with vb.net and I'm currently doing a project that includes access 2010

My question will be what driver can I use for an access 2010 *.accdb type file?

For a *.mdb it works perfectly well with
 ConnString ="Driver={Microsoft Access Driver (*.mdb)};Dbq=" & Application.StartupPath & "\CITSDB.mdb;Uid=Admin;Pwd=123;"
 


But, when I changed the mbd to accdb:

ConnString ="Driver={Microsoft Access Driver (*.accdb)};Dbq=" & Application.StartupPath & "\CITSDB.accdb;Uid=Admin;Pwd=123;"


It resulted in errors:

ERROR[HY000][Microsoft][ODBC Microsoft Access Driver]Could not find file '(unknown)'.
ERROR[IM006][Microsoft][ODBC Driver Manager]SQLSetConnetAttr failed
ERROR[HY000][Microsoft][ODBC Microsoft Access Driver]Could not find file '(unknown)'

And then it shows me that my code for

If dsLogin.Tables(0).Rows.Count = 1 Then 


IndexOutOfRangeException was unhandled
Cannot find table 0

I knew it must be the driver but I don't know what accdb driver I can use for the connstring.

This post has been edited by MarshaR: 08 October 2011 - 05:42 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Error: IndexOutOfRangeException

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Error: IndexOutOfRangeException

Posted 08 October 2011 - 06:32 AM

I think your driver dont support new access format. why dont you just use the old format?
Was This Post Helpful? 0
  • +
  • -

#3 MarshaR  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 08-October 11

Re: Error: IndexOutOfRangeException

Posted 08 October 2011 - 11:05 PM

Because I have to use an accdb file instead of a mdb file for my project as the task. :(
Was This Post Helpful? 0
  • +
  • -

#4 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Error: IndexOutOfRangeException

Posted 09 October 2011 - 04:55 AM

try this connection string then:
http://www.connectio...com/access-2007
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1