Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
I don't know many New Users that can write in VBA! I recommend that you post
this into microsoft.public.word.vba.beginners or microsoft.public.word.vba.general newsgroups for a faster response (although if you wait a while, one of the VBA gurus may pass by here later). -- Terry Farrell - Word MVP http://word.mvps.org/ "Ian Clark" wrote in message ... : 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
creating forms | Microsoft Word Help | |||
Boiletplates from Word Perfect | Microsoft Word Help | |||
Continuous breaks convert to next page breaks | Microsoft Word Help | |||
How to change merge forms from Word Perfect to Microsoft Word | Microsoft Word Help | |||
saving the workspace | Microsoft Word Help |