If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Problem with ADO and MSSQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-02, 12:09
bmkiss67 bmkiss67 is offline
Registered User
 
Join Date: Dec 2002
Posts: 4
Question Problem with ADO and MSSQL

We have just changed all of our DB functionality from the BDE with the standard component query to ADO with the ADOquery. The follow doesn’t work anymore now :

qRooms->Close();
qRooms->SQL->Clear();
qRooms->SQL->Add("Select * from Billeting where (SDATE >=:startdate and");
qRooms->SQL->Add("SDATE <=:enddate) or (EDATE >=:startdate and");
qRooms->SQL->Add("EDATE <=:enddate) or (SDATE <:startdate and");
qRooms->SQL->Add(" :startdate < EDATE) order by BLDG");
qRooms->Parameters->ParamByName("startdate")->Value = StrToDate(VOQDate);
qRooms->Parameters->ParamByName("enddate")->Value = (StrToDate(VOQDate) + 14);
qRooms->Open();

Why doesn’t this work? What am I doing wrong?
Reply With Quote
  #2 (permalink)  
Old 12-05-02, 12:59
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
What programming environment are you using ?
Reply With Quote
  #3 (permalink)  
Old 12-05-02, 19:13
bmkiss67 bmkiss67 is offline
Registered User
 
Join Date: Dec 2002
Posts: 4
Borland C++ Builder 6
Reply With Quote
  #4 (permalink)  
Old 12-05-02, 20:18
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
I am not familiar with bc++ 6 builder - but does it matter that no spaces exist between the 1st and 3rd add methods (I put # where a space was lacking) ?

qRooms->SQL->Add("Select * from Billeting where (SDATE >=:startdate and #");
qRooms->SQL->Add("# SDATE <=:enddate) or (EDATE >=:startdate and #");
qRooms->SQL->Add("# EDATE <=:enddate) or (SDATE <:startdate and");
Reply With Quote
  #5 (permalink)  
Old 12-06-02, 02:50
bex bex is offline
Registered User
 
Join Date: Nov 2002
Location: South Africa
Posts: 9
Re: Problem with ADO and MSSQL

What error are you getting?

Is it a runtime error, compile error - do you get an error at all..

More details please.

Stefan
Reply With Quote
  #6 (permalink)  
Old 12-06-02, 09:43
bmkiss67 bmkiss67 is offline
Registered User
 
Join Date: Dec 2002
Posts: 4
No errors, I just don't get all the data back. I run that in SQL analyzer and I get all the correct data back, but in Builder I only get some of the data back.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On