Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.CursorLocation = adUseClient
cn.Open "provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\Future\My Documents\abc.mdb(换成你的数据库);"
rs.Open "tem(换成数据库中的表)", cn rs.addnew
rs!字段名=text1.text
......
rs!update这样就是ADO。
Dim rs As New ADODB.Recordset
cn.CursorLocation = adUseClient
cn.Open "provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\Future\My Documents\abc.mdb(换成你的数据库);"
rs.Open "tem(换成数据库中的表)", cn rs.addnew
rs!字段名=text1.text
......
rs!update这样就是ADO。
dim adoCmd as new adodb.command
adoCnt.open "Provider=microsoft.jet.oledb.4.0;"&"data source=c:\documents and settings\future\my documents\abc.mdb"
with adoCmd
.activeconnection=adoCnt
.commandtext="insert into table1 values('" $ trim(text1.text) $ "')"
.execute
end with
strSQL="insert into booklist(bookname) values('" & text1.text & "')"
执行以后,将text1里的信息添加到booklist表的bookname字段中(bookname是文本型)
with rs
.addenw '修改字已经存字记录字段值时使用.edit
.fileds(字段名或字段序号)=值 '注意值与字段的类型区别
.updata
end with