View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rubble Rubble is offline
external usenet poster
 
Posts: 45
Default How can I get VBA to create a table or run a query in MS SQL?

K - I think I got it now -- I use

strQuery = "SELECT * FROM [Sheet1$A1:B10]"

in order to get the information that I want to update into MS SQL -- and
then after identifying the SQL database and all I use something like the
following :

sSQL = "INSERT INTO Contacts (FirstName, LastName) " & _
" VALUES (strQuery)"
oConn.Execute sSQL

Is that at least going down the correct road?

Thanks Again