Hi
I am new to Vb.Net and so far things have been working ok except for the updat/insert command. It's been preventing my program from proceeding for 5 days now. I've tried different stuff but either the code is completley wrong or there is an error which is hard to find.........
Can someone verify this code and let me know why the program wouldn't update the table
Thanks...
Here's the code
Conn=New OleDbConnection(".............................")
Comm=new OleDbCommand("Update tablename Set field1=' " & List1.SelectedIndex &" ' where glnx= ' " & (TxtGlnx.text) & ' "," conn)
r= Comm.ExecuteNonQuery
Conn.close()

Updating Records
InquiringMinds
If the code is exactly as above.. looks like a syntax problem
I pasted it into a module and there were several potential issues.
Leading space will be included in field value and where clause.... Where glnx = ' " &.... there is a space betten the single and double quote so even if it made it to the DB it likely wouldn't find the record to update.
The last part : &" ' where glnx= ' " & (TxtGlnx.text) & ' "," conn)
Actually comments out the everything after the last &
Again, this is all assuming that the statement above is verbatim in your code
Try this
Comm=
new OleDbCommand("Update tablename Set field1='" & List1.SelectedIndex &" ' where glnx= '" & (TxtGlnx.text) & "';", conn)HTH