🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3278

Re: Multiple Recordsets from a Single Expression ?

#3278
From: Peter Moscatt
Date: Sun, 13 Oct 2002 23:26
135 lines
5848 bytes
Ok....  from what I understand, you are asking for the SQL command I am issuing which ends up with the error I have explained.

The command which I place into a string beforehand is:

INSERT INTO Machine(Serial_Number,Model_Code,EqptNo) VALUES (DataFromLocal("Serial_Number",DataFromLocal(...


Note:  I am placing values which I have retrieved from another SQL command from another database.  Basically, the program needs to open two seperate databases and transfer data from the local to the remote, if that data dosen't exist.

If you want I can send you the code and you can have a quick look through it.


Pete








"Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote:
>Please send only string. It could look as follow:
>
>INSERT INTO MACHINE(Serial_Number,Model_Code,EqptNo) VALUES (1, 2, 3)
>
>Could you execute this command? You should at first look where error is - it
>may be in command text (it can be seen by examining cmdStr - without any
>ADODataSetLocal->FieldValues...) or when executing command. Also, if columns
>Serial_Number etc. are integer you should not quote their values. Could you
>execute query with parameters?
>
>----------------------------------------------------------------
>Regards,
>Viatcheslav V. Vassiliev
>http://www.oledbdirect.com
>The fastest way to access MS SQL Server and MS Jet (MS Access) databases.
>
>
>"Peter Moscatt" <pgmoscatt@optushome.com.au> �������/�������� � ��������
>���������: news:3da9f25c$1@newsgroups.borland.com...
>>
>> G'Day Vassiliev,
>>
>> How's it go'n over there ?
>>
>> Well, I have changed to ADOQuery but still end up with the same problem.
>>
>> The command I'm issuing is:
>>
>> cmdStr = "INSERT INTO MACHINE(Serial_Number,Model_Code,EqptNo) VALUES ('"
>+ ADODataSetLocal->FieldValues["Serial_Number"] + "','" +
>ADODataSetLocal->FieldValues["Model_Code"] + "','" +
>ADODataSetLocal->FieldValues["EqptNo"] + "')";
>>
>> Make any sense out of it ?
>>
>> Pete
>>
>>
>>
>> "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote:
>> >Could you send here the value of str (not code, but string that is
>assigned
>> >to CommandText)?
>> >You may have, for example, superfluous "," or ";". Check also that you
>> >insert as much values as you have columns in MACHINE table.
>> >
>> >----------------------------------------------------------------
>> >Regards,
>> >Viatcheslav V. Vassiliev
>> >http://www.oledbdirect.com
>> >The fastest way to access MS SQL Server and MS Jet (MS Access) databases.
>> >
>> >
>> >"Peter Moscatt" <pgmoscatt@optushome.com.au> �������/�������� � ��������
>> >���������: news:3da5fb5b$1@newsgroups.borland.com...
>> >>
>> >> G'Day Vassiliev,
>> >>
>> >> Gave it a try but still have the same error occuring.
>> >>
>> >> Pete
>> >>
>> >>
>> >>
>> >> "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote:
>> >> >Place eoExecuteNoRecords into ExecuteOptions property of
>> >ADODataSetRemote.
>> >> >If this does not help, provide command text, like
>> >> >
>> >> >str = "INSERT INTO MACHINE VALUES ('" +
>> >> >ADODataSetLocal->FieldValues["Serial_Number"] + "','TO30',1,'1','" +
>> >> >ADODataSetLocal->FieldValues["Model_Code"] + "','1','0.0.0.0','" +
>> >> >ADODataSetLocal-FieldValues["EqptNo"] + "',1)";
>> >> >
>> >> >ADODataSetRemote->CommandText = str;
>> >> >
>> >> >Write here the value of str.
>> >> >
>> >> >----------------------------------------------------------------
>> >> >Regards,
>> >> >Viatcheslav V. Vassiliev
>> >> >http://www.oledbdirect.com
>> >> >The fastest way to access MS SQL Server and MS Jet (MS Access)
>databases.
>> >> >
>> >> >"Peter Moscatt" <pgmoscatt@optushome.com.au> �������/�������� �
>��������
>> >> >���������: news:3da0fa4c$1@newsgroups.borland.com...
>> >> >>
>> >> >> I am trying to write data to an Access database using the code shown
>> >below
>> >> >but get a runtime error saying "Current provider does not support
>> >returning
>> >> >multiple recordsets from a single expression."
>> >> >>
>> >> >> The provider is set to: Microsoft.Jet.OLEDB.4.0
>> >> >>
>> >> >> How do I get around this problem ?
>> >> >>
>> >> >> Pete
>> >> >>
>> >> >> ADODataSetRemote->CommandText = "INSERT INTO MACHINE VALUES ('" +
>> >> >ADODataSetLocal->FieldValues["Serial_Number"] + "','TO30',1,'1','" +
>> >> >ADODataSetLocal->FieldValues["Model_Code"] + "','1','0.0.0.0','" +
>> >> >ADODataSetLocal->FieldValues["EqptNo"] + "',1)";
>> >> >
>> >> >
>> >>
>> >
>> >
>>
>
>
Technical Details
Message-ID: <3daa011f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail
References: <3da0fa4c$1@newsgroups.borland.com> <3da1233a@newsgroups.borland.com> <3da5fb5b$1@newsgroups.borland.com> <3da66830@newsgroups.borland.com> <3da9f25c$1@newsgroups.borland.com> <3da9f9c2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,85e61ef802f7259b
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-10-13 16:42:04 PST
From: "Peter Moscatt" <pgmoscatt@optushome.com.au>
Sender: "Peter Moscatt" <pgmoscatt@optushome.com.au>
Reply-To: "Peter Moscatt" <pgmoscatt@optushome.com.au>
Subject: Re: Multiple Recordsets from a Single Expression ?
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 202.138.18.194 202.138.18.194    
References: <3da0fa4c$1@newsgroups.borland.com> <3da1233a@newsgroups.borland.com> <3da5fb5b$1@newsgroups.borland.com> <3da66830@newsgroups.borland.com> <3da9f25c$1@newsgroups.borland.com> <3da9f9c2@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3daa011f$1@newsgroups.borland.com>
Date: 13 Oct 2002 16:26:23 -0700
X-Trace: newsgroups.borland.com 1034551583 207.105.83.65 (13 Oct 2002 16:26:23 -0700)
Lines: 137
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail