数据库新手的问题

JasonSeaver 2001-08-22 02:23:46
我用ACCESS2000建好了一个数据库,但是在设置recordsourse十却报错:无法识别的数据库格式,请问该如何解决
...全文
116 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
superjs 2001-08-22
注意引用对象的版本,这是老问题了,建议安装sp5
回复
x_bigman 2001-08-22
记得给分。VB6
回复
x_bigman 2001-08-22
DAO的例子(引用DAO3.6):
Dim WS As Workspace
Dim DB As Database
Dim RS As Recordset
Dim SQL As String
SQL = "SELECT * FROM YourTable where ……"
Set WS = CreateWorkspace("", "admin", "", dbUseJet)
Set DB = WS.OpenDatabase("f:\WORK\zls\ZLS.MDB", True, True, ";pwd=")
Set RS = DB.OpenRecordset(SQL, dbOpenDynaset)
回复
x_bigman 2001-08-22
Dim sConnect As String
Dim sSQL As String
Dim dfwConn As ADODB.Connection
Dim RS As Recordset

ADO的例子
sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\YourDB.mdb;"
sSQL = "* FROM YourTable where ……"
Set dfwConn = New Connection
dfwConn.Open sConnect

Set RS = New Recordset
RS.CursorLocation = adUseServer
RS.Open sSQL, dfwConn, adOpenDynamic, adLockReadOnly, 1
回复
haitao5676 2001-08-22
用ado吗?还是别的?
回复
相关推荐
发帖

1188

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2001-08-22 02:23
社区公告
暂无公告