Re: FMTONLY problems



Bob wrote:
"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:OQAeAwYoHHA.4516@xxxxxxxxxxxxxxxxxxxxxxx

You failed to provide the ADO code that is causing this behavior.


I'm using delphi, which has a wrapper around the ADO objects. I spent
a whole lot of time trying to work out what it was doing that was
causing the problem.
The first time it runs, it creates the bad FMTONLY statment and runs.
The second time it it does the bad FMTONLY, sets SET NO_BROWSETABLE
OFF, runs the SQL 3 times, SET NO_BROWSETABLE ON, does a correct
FMTONLY, SET NO_BROWSETABLE OFF, then executes the SQL again.
Below is the simplest example that I could come up with that exibits
the issue. Below that is a script to create a test database.


procedure TForm1.FailTest;
var
Conn: _Connection;
Cmd: _Command;
Records: _Recordset;

ADOCommandConstructionObj: ADOCommandConstruction;
ICommandObj: ICommand;
begin

Conn := CoConnection.Create;
Cmd := CoCommand.Create;
Records := CoRecordset.Create;

Conn.Open(
'Provider=SQLNCLI.1;' +
'Integrated Security=SSPI;' +
'Persist Security Info=False;' +
'Initial Catalog=TestDB;' +
'Data Source=.\SQL2005',
'', '', adConnectUnspecified);

Cmd.Set_ActiveConnection(Conn);
Cmd.CommandText :=
'IF NOT EXISTS ( ' + CRLF +
' SELECT SystemScanfileKey ' + CRLF +
' FROM SystemScanfileScan ' + CRLF +
' WHERE SystemScanfileKey = ? ' + CRLF +
' AND ScanKey = ? ' + CRLF +
' ) ' + CRLF +
'BEGIN ' + CRLF +
' INSERT INTO SystemScanfileScan ' + CRLF +
' (SystemScanfileKey, ScanKey) ' + CRLF +
' VALUES ' + CRLF +
' (?, ?) ' + CRLF +
' SELECT 1 ' + CRLF +
'END ' + CRLF +
'ELSE ' + CRLF +
' SELECT 0 ' + CRLF ;

OleCheck(Cmd.QueryInterface(ADOCommandConstruction,
ADOCommandConstructionObj));
OleCheck(ADOCommandConstructionObj.OLEDBCommand.QueryInterface(ICommand,
ICommandObj));

// there was a whole lot more code here to get parameter types,
names and direction etc

So do you get the FMTonly problem if you execute this Command without
bothering to get paameter types, etc?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: FMTONLY problems
    ... You failed to provide the ADO code that is causing this behavior. ... // there was a whole lot more code here to get parameter types, ... So do you get the FMTonly problem if you execute this Command without ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: Tabbing and drop outs?
    ... Simply refreshing the "broken" page will get it back up, but I don't know what's causing the problem generally. ... This seems to have passed, now, but I have recently started to get intermittent DNS problems which affect Firefox, Pegasus Mail and Thunderbird. ... The reply address is a spam trap. ...
    (uk.telecom.broadband)
  • Re: Tabbing and drop outs?
    ... Simply refreshing the "broken" page will get it back up, but I don't know what's causing the problem generally. ... This seems to have passed, now, but I have recently started to get intermittent DNS problems which affect Firefox, Pegasus Mail and Thunderbird. ... The reply address is a spam trap. ...
    (uk.telecom.broadband)
  • Re: Multiple-step_operation_generated_errors._Check_each_status_va
    ... Larry wrote: ... > I am looking to see what could be causing this error. ... You must have supplied a password in the connection's Open statement. ... This email account is my spam trap so I ...
    (microsoft.public.scripting.vbscript)
  • Re: Multiple-step_operation_generated_errors._Check_each_status_va
    ... >> I am looking to see what could be causing this error. ... > You must have supplied a password in the connection's Open statement. ... This email account is my spam trap so I ...
    (microsoft.public.scripting.vbscript)