cj92713696
Programmer
I wrote a Visual Basic 6 application that works great w/Access using the data environment. I want to port my existing app. to work w/SQL Server. I assumed it would be as easy as just changing my provider in my Data Environment to SQL Server. I have run into a problem w/my SQL variables. It appears as though Microsoft SQL Server doesn't assess the variables the same way Access does.
Here's an example query:
SELECT * FROM STORE WHERE
(Store.StoreCode = @StoreCode AND Store.StoreDesc = "1"
OR
(Store.StoreCode = @StoreCode AND Store.StoreDesc = "2"
;
In this example, I have the variable @StoreCode listed twice. The only way I can get Microsoft SQL Server to acknowledge that @StoreCode is a variable is to replace it with a ?. @StoreCode then becomes two seperate variables. Is there another way to declare variables w/the Data Environment that SQL Server will acknowledge?
Thanks,
CJ
Here's an example query:
SELECT * FROM STORE WHERE
(Store.StoreCode = @StoreCode AND Store.StoreDesc = "1"
OR
(Store.StoreCode = @StoreCode AND Store.StoreDesc = "2"
In this example, I have the variable @StoreCode listed twice. The only way I can get Microsoft SQL Server to acknowledge that @StoreCode is a variable is to replace it with a ?. @StoreCode then becomes two seperate variables. Is there another way to declare variables w/the Data Environment that SQL Server will acknowledge?
Thanks,
CJ