Thread: Question Help with Database class
View Single Post
  #2 (permalink)  
Old 11-23-2008, 12:05 PM
Troy's Avatar
Troy Troy is offline
VB.NET Forum Genius
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Feb 2005
Age: 41
Posts: 153
Reputation: 68
Troy is on a distinguished programming path ahead
Default

Hi, ok for starters The first thing you need to do is change a few lines.

To open an access DB with code you you will need to specify it as OLEDB

This line:

Quote:
Imports System.Data.SqlClient
Should be:

Code:
Imports System.Data.OleDB
this line:

Quote:
Private database_Connection As New SqlConnection()
should be this:

Code:
Private database_Connection As New OleDbConnection()
Next you will need to change this line:

Quote:
Dim cmd As New System.Data.SqlClient.SqlCommand(SQL_Statement, database_Connection)
to this:

Code:
Dim cmd As New OleDbCommand(SQL_Statement, database_Connection)
That should get you working .
__________________
Visual Studio Professional 2008
Microsoft Vista Utimate 64 bit
Reply With Quote