Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with set OpenDataBase Statement in SQL
Hi Guys,
I have some problem with declaring the address for my Database. If it is from a worksheet source or access DB, it will be easier, but it is from the SQL server..how should i write it in the brackets(See arterisk statement)? example codes below. ThisWorkbook.Activate 'Open the database Set dbs = OpenDatabase("tti_qap;Trusted_Connection=Yes") * vtSql = "" vtSql = vtSql & " SELECT tbl_inventory_ADC.col_mfr, tbl_inventory_ADC.col_avecost " vtSql = vtSql & " FROM " & Product.dbo.tbl_inventory_ADC vtSql = vtSql & " WHERE (tbl_inventory_ADC.col_avecost = 0.0001)" vtSql = vtSql & "ORDER BY (tbl_inventory_ADC.col_mfr)" Set rs = dbs.OpenRecordset(vtSql) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with IF Statement | Excel Worksheet Functions | |||
Re - If Statement Problem | Excel Programming | |||
I have an "IF"Statement problem...please help!! | Excel Worksheet Functions | |||
OpenDatabase-Problem | Excel Programming | |||
Dao.OpenDatabase gives me error when ... | Excel Programming |