View Single Post
  #1   Report Post  
Ian Clark
 
Posts: n/a
Default Trying to create word macro to insert into SQL Server

Have the following macro that inserts records from SQL table -

Selection.Range.InsertDatabase Format:=0, Style:=0, LinkToSource:=False, _
Connection:= _
"Provider=MSDASQL.1;Persist Security Info=True;Extended
Properties=""DSN=Spirit Group;UID=sa;APP=Microsoft Office
2003;WSID=YOUR-HKI1ASH75M;DATABASE=Spirit Group"";Initial Catalog=Spirit
Group" _
, SQLStatement:="SELECT * FROM ""HEATDb""" & "",
PasswordDocument:="", _
PasswordTemplate:="", WritePasswordDocument:="",
WritePasswordTemplate:= _
"", DataSource:= _
"C:\Documents and Settings\ian_clark.SOLUTEC\My Documents\My Data
Sources\Spirit Group HEATDb.odc" _
, From:=-1, To:=-1, IncludeFields:=True

How can I insert into this table i.e. need to do the following the SQL
syntax is €“ insert into
heatdb (dbname,tablename) values (€˜abcd,abcd)

Is it possible via a word macro?


--
Thanks for any assistance you can give.

Cheers
Ian