在VB中使用Insert
请问如何在vb中使用带变量的insert语句对access数据库进行添加记录。 问题点数:30、回复次数:1Top
1 楼cgb_prince(prince)回复于 2001-11-03 17:38:19 得分 30
dim strSQL as string
dim strInsert as string
dim strT_F as string
dim strValues as string
dim intField1 as integer
dim strField2 as string
dim lngField3 as long
intField1=0
strField2="12345"
lngField3=9
strInsert = "Insert Into" & space(1)
strT_F = "TableName(field1,field2,field3)" & space(1)
strValues = "Values(" & cstr(intField1) & ",'" & strField2 & "'," & cstr(lngField3) & ")"
strSQL=strInsert & strT_F & strValues
Top




