Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Run make table query from Excel with Access closed

I have an make table query in Access that I want to be able to run from
Excel. Ultimately I would like to be able to run the make table with Access
closed and no messages appearing until the table is made...then a notice
saying the make table is complete. Is there any way to run a make table
access query from Excel without opening Access? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Run make table query from Excel with Access closed

Kick this around. Should help
Sub makeTable()
'Needs reference the Axtive X Library 2.0 or higher
Dim cn As ADODB.Connection
Dim sCnn As String
Dim sTableName As String
Dim sMakeTableName As String

sTableName = "Table name"
sMakeTableName = "Make Table Name"

Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0;"
.ConnectionString = "Data Source=C:\Database.mdb"
.Open
.Execute ("SELECT " & sTableName & ".* INTO " & sMakeTableName & "
FROM " & sTableName & "")
.Close
End With
Set cn = Nothing

End Sub

"deeds" wrote:

I have an make table query in Access that I want to be able to run from
Excel. Ultimately I would like to be able to run the make table with Access
closed and no messages appearing until the table is made...then a notice
saying the make table is complete. Is there any way to run a make table
access query from Excel without opening Access? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Run make table query from Excel with Access closed

Thanks...however, it is stopping at: Dim cn As ADODB.Connection any ideas?
Thanks again.

"Mike" wrote:

Kick this around. Should help
Sub makeTable()
'Needs reference the Axtive X Library 2.0 or higher
Dim cn As ADODB.Connection
Dim sCnn As String
Dim sTableName As String
Dim sMakeTableName As String

sTableName = "Table name"
sMakeTableName = "Make Table Name"

Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0;"
.ConnectionString = "Data Source=C:\Database.mdb"
.Open
.Execute ("SELECT " & sTableName & ".* INTO " & sMakeTableName & "
FROM " & sTableName & "")
.Close
End With
Set cn = Nothing

End Sub

"deeds" wrote:

I have an make table query in Access that I want to be able to run from
Excel. Ultimately I would like to be able to run the make table with Access
closed and no messages appearing until the table is made...then a notice
saying the make table is complete. Is there any way to run a make table
access query from Excel without opening Access? Thanks.

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
ADOBO control of Access Make Table query Peter G[_3_] Excel Programming 0 November 6th 09 11:46 AM
execute a make table query in an access database Question Boy Excel Programming 1 April 18th 08 04:07 PM
Run Make table query from Excel RW Excel Programming 1 January 24th 06 05:33 PM
Copy recordset from an Access "make table" query Laurie[_4_] Excel Programming 1 February 5th 04 09:45 AM
Linking a table in Access to a table in Excel using MS Query Diana[_5_] Excel Programming 1 January 16th 04 09:43 PM


All times are GMT +1. The time now is 08:58 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"