Hello !
I'm using a DAO-connection to a SQL-Server 2000. This means I'm linking tables from a database on the server to my Access-Database.
Now I want to know how can I use a simple select-query in VBA to get back a useable value (for use in a variable i.e.) ?
I don't want to use the table as source in a form or in
a query in Access, because I need 3 values (maximum value from 3 different columns in one table) in 3 variables.
Can I directly query the SQL-Server 2000 with Transact-SQL and get back a value (in VB-Code ??) or is there a possibility to execute an Access-SQL query to get back a value ? And I need to do it in VBA !!
PS: My queries all give back only one value (the maximum value in a table).
PPS: The queries are ready to use and do work in Access-queries and Query-Analyzer, I just need the code HOW I get these values in variables !!!
Thanks in advance,
Jens.
I'm using a DAO-connection to a SQL-Server 2000. This means I'm linking tables from a database on the server to my Access-Database.
Now I want to know how can I use a simple select-query in VBA to get back a useable value (for use in a variable i.e.) ?
I don't want to use the table as source in a form or in
a query in Access, because I need 3 values (maximum value from 3 different columns in one table) in 3 variables.
Can I directly query the SQL-Server 2000 with Transact-SQL and get back a value (in VB-Code ??) or is there a possibility to execute an Access-SQL query to get back a value ? And I need to do it in VBA !!
PS: My queries all give back only one value (the maximum value in a table).
PPS: The queries are ready to use and do work in Access-queries and Query-Analyzer, I just need the code HOW I get these values in variables !!!
Thanks in advance,
Jens.