Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default sql querries

Hi,
this is an excel/access question. i was wondering how to
make excel run a querry in access and put the result of
the querry into a spreadsheet.

thanx a lot
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default sql querries


-----Original Message-----
Hi,
this is an excel/access question. i was wondering how to
make excel run a querry in access and put the result of
the querry into a spreadsheet.

thanx a lot
.


Turn DAO reference on:

Sub Ret_Acc_Qry


Dim dbs as database
dim sql as string
dim rst as recordset

fname = "filename of database"

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbs = wrkJet.OpenDatabase(fname, True)

sql = "sql statement"

set rst = dbs.openrecordset(sql)
h=0

for each fld in rst.fields
activesheet.[a1].offset(0,h).value = fld.name
next fld

activesheet.range("a2").copyfromrecordset rst

dbs.close
end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default sql querries

Mr. Erlandsen's site has examples of using ADO or DAO
http://www.erlandsendata.no/english/...php?t=envbadac

you can use Data=Get External Data possibly.



--
Regards,
Tom Ogilvy



"delali" wrote in message
...
Hi,
this is an excel/access question. i was wondering how to
make excel run a querry in access and put the result of
the querry into a spreadsheet.

thanx a lot



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default sql querries


-----Original Message-----
Hi,
this is an excel/access question. i was wondering how to
make excel run a querry in access and put the result of
the querry into a spreadsheet.

thanx a lot
.
Sorry before next fld in my response you need h=h+1


nath
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
Multiple sheet querries G Ray Excel Worksheet Functions 4 March 20th 10 03:36 PM
Stumped on establishing web querries on MS Excel Chris Excel Discussion (Misc queries) 9 August 16th 09 04:23 PM


All times are GMT +1. The time now is 09:59 AM.

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

About Us

"It's about Microsoft Excel"