Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with IF Statement M Peddle Excel Worksheet Functions 9 July 28th 08 07:18 PM
Re - If Statement Problem Robert Hargreaves Excel Programming 0 May 28th 05 01:30 PM
I have an "IF"Statement problem...please help!! cmk0007 Excel Worksheet Functions 1 November 5th 04 01:24 AM
OpenDatabase-Problem Chip Pearson Excel Programming 1 January 20th 04 03:05 PM
Dao.OpenDatabase gives me error when ... Marek S. Excel Programming 0 July 28th 03 12:12 PM


All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"