数据库中的表名不能以数字开头
'获取数据过程
PrivateSub GetData()
conn =New OleDb.OleDbConnection
conn.ConnectionString ="Provider=Microsoft.jet.oledb.4.0;Data Source=HI.mdb"
conn.Open()
'创建sql命令
comm =New OleDb.OleDbCommand
comm.CommandText ="select * from HI03to10"
comm.CommandType = CommandType.Text
comm.Connection = conn
'创建DataAdapter用于填充Dataset
da =New OleDb.OleDbDataAdapter(comm)
da.Fill(ds, "HI03to10") '表的名称不能是数字开头的,否则出错
conn.Close()
End Sub
PrivateSub GetData()
conn =New OleDb.OleDbConnection
conn.ConnectionString ="Provider=Microsoft.jet.oledb.4.0;Data Source=HI.mdb"
conn.Open()
'创建sql命令
comm =New OleDb.OleDbCommand
comm.CommandText ="select * from HI03to10"
comm.CommandType = CommandType.Text
comm.Connection = conn
'创建DataAdapter用于填充Dataset
da =New OleDb.OleDbDataAdapter(comm)
da.Fill(ds, "HI03to10") '表的名称不能是数字开头的,否则出错
conn.Close()
End Sub