在CommandText里写上你的Insert的SQL,然后再Execute不就行了

解决方案 »

  1.   

    ADOCommand1.CommandText := 'insert into Btslb(LeiBieID,LeiBieName) values(edit1.text,edit2.text)';ADOCommand1.Execute;编译通过,可是添加的时候总是发生以下错误!!!The text is not permitted in this context.Only constants,expressions
    or variables allowed here column names are not permitted.
    这是怎么回事??
      

  2.   

    ADOCommand1.CommandText := 'insert into Btslb(LeiBieID,LeiBieName) values("' edit1.text+'","' + edit2.text+'")';
      

  3.   

    当然不行
    试下以下语句吧
    wl_Temp_Sql:='insert into Btslb(LeiBieID,LeiBieName) values(';
    wl_Temp_Sql:=wl_Temp_Sql+''''+edit1.text+'''';
    wl_Temp_Sql:=wl_Temp_Sql+''''+edit2.text+'''';
    wl_Temp_Sql:=wl_Temp_Sql+')';
    ADOCommand1.CommandText := wl_Temp_Sql
      

  4.   

    呵呵是这样子,比如你要插入一条纪录
    这个对?  INSERT INTO TABLE1(ID,NAME) VALUES(1,'DEL_C_SHARP')
    还是这个?INSERT INTO TABLE1(ID,NAME) VALUES(1,DEL_C_SHARP)注意字符串类型的引号!!!!!呵呵
      

  5.   

    对呀!你的语法有错误!
    写的SQL语法中的变量应该单独写!应注意语法!
    楼上,写的对!