When i type
"dbProvider = "provider=microsoft.ace.oledb.12.0;"
dbSource = "data source = d:/data1.accdb"
con.ConnectionString = dbProvider & dbSource
con.Open()
sql = "select * from table 1"
da = New OleDb.OleDbDataAdapter(sql, con)
MsgBox("database is now open")
da.Fill(ds, "ohr id/phr id")
con.Close()
MsgBox("database is now closed")"
However when i type the following code with a change in the sql query. It shows OLEDB Exception occurs.
"dbProvider = "provider=microsoft.ace.oledb.12.0;"
dbSource = "data source = d:/data1.accdb"
con.ConnectionString = dbProvider & dbSource
con.Open()
sql = "select column 1 from table 1"
da = New OleDb.OleDbDataAdapter(sql, con)
MsgBox("database is now open")
da.Fill(ds, "ohr id/phr id")
con.Close()
MsgBox("database is now closed")"
Please tell me what is going wrong?. Thanks in advance P.S.:the code waroks fine till MsgBox("database is now open")...the problem appears only in da.Fill(ds,"...")