strsql = "insert into s_info(s_rcbase,s_rjava,s_rc,s_rdbase)values(Text2.Text,Text3.Text,Text4.Text,Text5.Text)  where s_no='" & Trim(Text1.Text) & "'"
 Set myrecord = myconn.Execute(strsql)
If Not myrecord.EOF Then这个句子那儿有错啊,提示:在where处有错啊

解决方案 »

  1.   

    strsql = "insert into s_info(s_rcbase,s_rjava,s_rc,s_rdbase)values('" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & ")  where s_no='" & Trim(Text1.Text) & "'"
      

  2.   

    strsql = "insert into s_info(s_rcbase,s_rjava,s_rc,s_rdbase)values('"& Text2.Text &"','"& Text3.Text &"','"& Text4.Text &"','"& Text5.Text &"')"
      

  3.   

    strquerysql = Empty
    If ((Text1.Text = "") Or (Len(Text1.Text) <> 10)) Then
    MsgBox "请输入十位数的学号!", vbInformation + vbOKOnly, "系统提示!"
    Exit Sub
    End If
     strsql = "insert into s_info(s_rcbase,s_rjava,s_rc,s_rdbase)values('" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & ")  where s_no='" & Trim(Text1.Text) & "'"
    Set myrecord = myconn.Execute(strsql)
    If Not myrecord.EOF Then
    myrecord.Update
     
    Else
     MsgBox "对不起!没有您检索的学号!", vbInformation + vbOKOnly, "检索警告!"
      

  4.   

    我是按where s_no='" & Trim(Text1.Text) & "'"条件插入数据的啊
      

  5.   

    把这句粘上去:
    strsql = "insert into s_info(s_rcbase,s_rjava,s_rc,s_rdbase)values('" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "')  where s_no='" & Trim(Text1.Text) & "'"
      

  6.   

    strsql = "insert into s_info(s_no,s_rcbase,s_rjava,s_rc,s_rdbase)values('" & Trim(Text1.Text) & "','" & Text2.Text &"','" & Text3.Text &"','" & Text4.Text & "','" & Text5.Text &"')"insert 语句有两种格式:INSERT INTO tablename(field1,field2,...,fieldn) VALUES(value1,value2,...,valuen)或INSERT INTO table1 SELECT field1,field2,...,fieldn FROM table2 [WHERE ...]WHERE, ORDER BY, GROUP BY 等子句仅可以用于 SELECT 方式。
      

  7.   

    insert 是不能用 where的,因为它不需要条件, 
    insert into a
    select * from b
    这个时候可以在select 的时候做条件限制.