开发者

vb6 recordset sql query

开发者 https://www.devze.com 2022-12-10 17:47 出处:网络
How to use append query in vb6 with access db开发者_运维知识库 having a password? The following is giving an error.

How to use append query in vb6 with access db开发者_运维知识库 having a password? The following is giving an error.

dim s as string
s="insert into patientprofile(crno) select patientprofile.crno from 'd:\liverrecord.mdb' & 'Jet OLEDB:Database Password=liver'"


It's not exactly clear what you want. However,

You first have to reference Microsoft DAO 3.6 Object Library. You can then open a database with the following two lines.

Dim Engine As DAO.DBEngine: Set Engine = New DAO.DBEngine
Dim DB As DAO.Database: Set DB = _
       Engine.Workspaces(0).OpenDatabase("D:\LiveRecord.mdb", false, false, _
       "MS Access;PWD=liver")

You can access the sql statement with

Call DB.Execute("insert etc")
0

精彩评论

暂无评论...
验证码 换一张
取 消