inserting rows from textbox to table

vbado
04-20-2004, 07:35 AM
Hi,
I have been trying to insert textbox value to table.
Here is my code
x = Text1.Text
y = Text2.Text
MyConn.Execute ("INSERT INTO PUBLISHERS(Name,CompanyName) values ('&x','&y')")

If i use this code,the datas r not inserting from textbox,instead '&x' is added as one row in the table. :rolleyes:
Can Anyone help me out..


vbado

MKoslof
04-20-2004, 07:45 AM
Dim sSQL as string

sSQL = "INSERT INTO PUBLISHERS([Name], CompanyName) VALUES('" & x & "', '" & y & "')"

myConn.execute sSQL

myConn.close
Set myConn = Nothing

vbado
04-20-2004, 08:42 AM
Thanks a lot.
Now it works fine for me.

MKoslof
04-20-2004, 08:46 AM
No problem, always glad to help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum