W
wfzha
Unregistered / Unconfirmed
GUEST, unregistred user!
我查了一下资料,ActiveConnection不能像你那样用法,应该定义ADODB.conncetion对象
然后再赋值,但赋值语句总写不对,你参考一下:
conStr:='Provider=Microsoft.Jet.OLEDB.4.0; Jet OLEDB:Engine Type=5;Password="";User ID=Admin;Data Source=E:/db1.mdb';
objADOXDatabase := CreateOleObject('ADOX.Catalog');
objADOConnection:= CreateOleObject('ADODB.Connection');
objADOConnection.ConnectionString:=conStr;
objADOConnection.open;
objADOXDatabase.Set_ActiveConnection(objADOConnection.ConnectionObject);//此处不对
然后再赋值,但赋值语句总写不对,你参考一下:
conStr:='Provider=Microsoft.Jet.OLEDB.4.0; Jet OLEDB:Engine Type=5;Password="";User ID=Admin;Data Source=E:/db1.mdb';
objADOXDatabase := CreateOleObject('ADOX.Catalog');
objADOConnection:= CreateOleObject('ADODB.Connection');
objADOConnection.ConnectionString:=conStr;
objADOConnection.open;
objADOXDatabase.Set_ActiveConnection(objADOConnection.ConnectionObject);//此处不对