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 > Other > ODBC Problem with Progress using VS2005

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-10-07, 04:02
pu43x pu43x is offline
Registered User
 
Join Date: Jul 2007
Posts: 1
ODBC Problem with Progress using VS2005

Hi All,

I have recently started a new job and trying to get to grips with Visual Studio 2005, I have successfully created a database link to MSSQL server running locally on my machine using the DataSet functionality within VS2005. I have now run into problems however when trying to set up a query to connect to a Progress database using the same method.

I can successfully create the connection and pull out records, however when I create a dynamic query such as (SELECT "column1" FROM "table1" WHERE "column1" = '@variable') I run into problems.

With the nature of the Progress ODBC connection we need to include the quotes around each column and variable, however the input variable "@variable1" is not recognised and forces ASP.NET and VS to throw an error.

Does anybody out there have any suggestions? Please bare with me as I have only been using VS2005 for about 3 days now.

Many thanks for your time.

Gareth
Reply With Quote
  #2 (permalink)  
Old 09-05-07, 11:54
iTIE iTIE is offline
Registered User
 
Join Date: Sep 2007
Posts: 2
Double-quotes need to be escaped in SQL queries, and since Progress fields can have silly names that require those lovely quotes you need to do something like this (if you're just building a query as a string that is):

Code:
string theQuery = "SELECT \"" + columnName + "\" FROM pub.\"" + tableName + "\" WHERE \"" + columnName + "\" = \"" + variable = "\"";
Personally, I'm very happy every day that I take one more step further away from working with Progress.

I hope that helps.
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