Hi,
I would like to duplicate table from SQL Server 2000 to Access using VBA.
Could anyone please show me how to programmatically establish a connection to SQL Server using VBA codes?
Thanks in advance.
Hi,
I would like to duplicate table from SQL Server 2000 to Access using VBA.
Could anyone please show me how to programmatically establish a connection to SQL Server using VBA codes?
Thanks in advance.
Just curious-- Why?
Why not link or import?
I want to use sql query to link only certain data into Access.
I found Linked Table doesn't provide this capability for us to specify the condition on selecting data using sql query.Instead, it will import whole table. Hence, i want to try to link using query programmatically.
Do you have any idea on this? to link table using query via Linked table?
Have you tried linking the table, then creating a query to select only the fields you are interested in?
For example the table (hostTable) contains fields f1,f2,f3,f4,f5...f99 and you are interested in f2,f36 and f50.
Link to table hostTable
create MyQuery where you Select f2,f36,f50 from hostTable
You can then use MyQuery as you wish.
Have you tried linking the table, then creating a query to select only the fields you are interested in?
For example the table (hostTable) contains fields f1,f2,f3,f4,f5...f99 and you are interested in f2,f36 and f50.
Link to table hostTable
create MyQuery where you Select f2,f36,f50 from hostTable
You can then use MyQuery as you wish.
I get what you mean. Could you provide me the vba codes to do so?