vb6 recordset sql query
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")
精彩评论