Reply
 
Thread Tools Display Modes
  #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
  #2   Report Post  
TF
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating forms Fluffypink Microsoft Word Help 4 March 9th 05 04:17 PM
Boiletplates from Word Perfect linda Microsoft Word Help 1 January 28th 05 05:37 PM
Continuous breaks convert to next page breaks Jennifer Hunt Microsoft Word Help 2 December 30th 04 05:45 PM
How to change merge forms from Word Perfect to Microsoft Word dollfindance Microsoft Word Help 2 December 30th 04 03:35 PM
saving the workspace Mike Microsoft Word Help 3 December 8th 04 11:32 PM


All times are GMT +1. The time now is 01:12 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"