Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert a record using SQL

Status
Not open for further replies.

irocz

IS-IT--Management
Oct 28, 2001
25
US
Hi,
I am trying to use SQL to insert records in a table without the use of a Data control, my connection string works, I've been successfull using Select * from table, but I can't use a string to insert using the execute method, Is there another way, or am I missing something?
Here is what I have :
Dim db as database
Dim rs as recordset
set db = opendatabase("c:\folder",false,false,"dbase iii;")
set rs = openrecordset("select * from table order by date")
db.execute "Insert into table(field1,field2) values(variable1,variable2);"
Thanks for your help
 
I would build it into an XML document then Use a XSLT doc to create the table.
 
I think you either responded to the wrong thread or, if not, I do not understand your response, since I do not know xml. I already built the table, just want to add to it.
thanks
 
You might try the following:

Assuming that variable1 and variable2 are stringvariables:

db.execute "Insert into table(field1,field2) values('" & variable1 & "', '"& variable2 & "');"
Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top