关于insert into
我用win2000server+vb6.0+access2002+ADO向access中添加记录,语句如下:
dim cn as new adodb.connection
dim rs as new adodb.recordset
connstr="provider=microsoft.jet.coldb.4.0;data source="+app.path+"\program.mdb;mode=readwrite|share deny none;persist security info=false"
cn.connectionstring=connstr
cn.open
with MSHFlexGrid1
for i=1 to .rows-2
id=.textmatrix(i,0)
names=.textmatrix(i,1)
manufacturer=.textmatrix(i,2)
versions=.textmatrix(i,3)
types=.textmatrix(i,4)
time_length=.textmatrix(i,5)
table_name=inputbox("请输入名称!","保存")
sql="insert into program (id,names,manufacturer,versions,types,time_length,table_name) values(id,names,manufacturer,versions,types,time_length,table_name)"
rs.open sql,cn,1,1
next
程序一运行后,提示
run-time error '3001'
变量或者类型不正确,或者不在可以接受的范围之内,要不就是与其他数据冲突。
我看过库中的数据类型全是“文本”类型,应该不会有错吧,可就是有问题,不知何故?后来我把变量全换成字符串,没有问题,但库中却没有数据,请高手帮忙。