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 the following SQL syntax is â?? insert into
heatdb (dbname,tablename) values (â??abcdâ??,â??abcdâ??)

Is it possible via a word macro?

Re: Trying to write a word macro that writes a record to a SQL server. by Cindy

Cindy
Sun Mar 27 10:05:50 CST 2005

Hi =?Utf-8?B?SWFuIENsYXJr?=,

> How can I insert into this table the following SQL syntax is â?? insert into
> heatdb (dbname,tablename) values (â??abcdâ??,â??abcdâ??)
>
> Is it possible via a word macro?
>
No, you can't manipulate the result of a DATABASE field using SQL. What you
could, perhaps, do is use ADO to get the information, then automate the table
the DATABASE insertion creates to enter the information. I'm just not clear on
exactly what you're trying to accomplish, here.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


Re: Trying to write a word macro that writes a record to a SQL ser by iclark2001

iclark2001
Mon Mar 28 09:23:07 CST 2005

Used ADO to accomplish the task

Many thanks


"Cindy M -WordMVP-" wrote:

> Hi =?Utf-8?B?SWFuIENsYXJr?=,
>
> > How can I insert into this table the following SQL syntax is ââ?¬â?? insert into
> > heatdb (dbname,tablename) values (ââ?¬Ë?abcdââ?¬â?¢,ââ?¬â?¢abcdââ?¬â?¢)
> >
> > Is it possible via a word macro?
> >
> No, you can't manipulate the result of a DATABASE field using SQL. What you
> could, perhaps, do is use ADO to get the information, then automate the table
> the DATABASE insertion creates to enter the information. I'm just not clear on
> exactly what you're trying to accomplish, here.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
>
>