new diffeculty! Inserting rows in datagrid!

Dear friends, i have anew problame where i am using text1.text to enter a tuple in a row but it's not working and telling syntex error i tried all kind of possibleties to do that but faint at last i am using ADODC+datagrid so, i should right the code here and please if you also tell me if there is more than one field to inserted so how i should write the qurey for?



Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then

DataGrid1.ClearFields
'sql = ("select * from AUH_HOUSE as a
sql = ("INSERT INTO AUH_HOUSE (HOUSE_ID) VALUES = '" & Trim(Text1.Text) & "'")

'sql = ("select a.HOUSE_ID, a.Owner_ID, a.Owner_Name, a.Area_name, a.Road_Name, a.Building_T, a.Building_A, o.Gender, o.Family_NO, o.Emirate_Code, o.No_buildings from AUH_HOUSE As a , Owner_Ship As o where a.Owner_ID = o.Owner_ID and a.HOUSE_ID = '" & Trim(Text1.Text) & "'")
'This specifies that the type of the ADODC is for SQL
Adodc1.CommandType = adCmdText
'This assigns the SQL result to the ADODC
Adodc1.RecordSource = sql
Adodc1.Refresh
'The result from the SQL will then be used
'to populate the datagrid
Set DataGrid1.DataSource = Adodc1
End If
End Sub
[1294 byte] By [boohamad] at [2007-11-20 11:08:44]
# 1 Re: new diffeculty! Inserting rows in datagrid!
Hi !
Please use correct codetags so we get a readable code
JonnyPoet at 2007-11-9 19:33:47 >
# 2 Re: new diffeculty! Inserting rows in datagrid!
what type is House_Id? You are inserting a string.
dglienna at 2007-11-9 19:34:58 >