|
-
Dec 29th, 2002, 06:08 AM
#1
Thread Starter
New Member
can't run ExcuteReader...
I trying to fconnect my form to microsoft access table and i"m getting the same error all the time:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
the code is:
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Dim name As String
Dim sql As String
Dim cn As New OleDb.OleDbConnection()
Dim dr As OleDb.OleDbDataReader
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and Settings\éðéá\My Documents\àìáåí úîåðåú.mdb"
cn.Open()
sql = "select * from mainform"
Dim cmd As New OleDb.OleDbCommand()
cmd.Connection = cn
cmd.CommandText = sql
dr = cmd.ExecuteReader()
While dr.Read()
Debug.Write(dr("picture"))
End While
dr.Close()
cn.Close()
End Sub
and i get the error when he get's to the executereader line.
what should i do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|