Hi All,
Is it possible to create a Make Table query in access (2.0 and 2003)
that creates the table into a SQL Server database?
Following the steps:
1- Create New Query
2- Set Query Type as Make-Table query
3- Enter table name
4- Click "Another Database", click Browse, then I cannot see anything
about data sources, ODBC, or SQL Server in the drop down box !!! only
few file types like *.mdb, *.adp, ...etc.
I already setup a ODBC data source.
If this is not supported from the GUI, then what is the SQL syntax? in
other words, SELECT * INTO Table1 IN "???" FROM Table2
Thanks for reading.
Mourad 9 18717
I am fairly certain that you can't create a table in Sql Server from an
Access mdb using ODBC. But you can certainly create a table on the
server from an Access mdb using ADO. First make a reference to the
Microsoft ActiveX Data Objects 2.5 (or higher) Library. From a code
module (you have to be in a code module to do this) go to the
Tools/References menu and select Microsoft ActiveX Data Objects 2.5 (or
2.6...) Library
And here is a code sample:
Sub CreateServerTable()
Dim cmd As New ADODB.Command
cmd.ActiveConnection = "Provider=SQLOLEDB; Data
Source=yourServer;Database=yourDB;UID=steve;passwo rd=abc;"
'--or if you have windows integrated security set
'cmd.ActiveConnection = "Provider=SQLOLEDB; Data
Source=yourserver;Database=yourDB;Trusted_Connecti on=Yes"
cmd.ActiveConnection.CursorLocation = adUseClient
cmd.CommandType = adCmdText
cmd.CommandText = "Create Table tbl1(rowID int Identity(1,1), fld1
varchar(50), Datefld datetime, fld3 varchar(50))
cmd.Execute
cmd.ActiveConnection.Close
End Sub
Rich
*** Sent via Developersdex http://www.developersdex.com ***
Rich P wrote:
I am fairly certain that you can't create a table in Sql Server from
an Access mdb using ODBC. [snip]
I can think if no reason why a passthrough query that executed a CREATE
TABLE statement would not work via ODBC. Assuming of course the user has
permissions to create tables.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
lol nice lyle ill play the worlds smallest violin for you.
My question would be why are you trying to use a make table query.
The data in one is redundant as soon as you make it. It is only good
for maybe doing a series of reports on a very complex query that takes
a very long time to run.
Thanks, Lord Kelvan and lyle fairfield for your valuiable input,
It's really worth to converting the Make-Table to pass-through
queries, however, it's worth mentioning the following:
1- The Make-Tables queries already exists, there are simply hundreds
of them! As I mentioned earlier, I'm moving from Access 2.0 back-end
to SQL Server.
2- The Make-Table queries join both Tables and Queries! The joined
queries further join tables and queries, and so on! The joined tables
could reside in both SQL Server and/or the local Access MDB file!! I'm
not sure how the ODBC/SQL Server will handle this! but it's worth to
try!
3- Losing the Query Design view for Pass Through queries is a little
discouraging!
This is a part of migrating an existing application, that was designed
using Access/File Server framework.
I will give it a shot to see how Access will handle this.
Thanks again,
Mourad
I think you are likely to find the problems lie with creating SQL Server
tables from Access via ODBC. With some care, you may be able to create the
tables in SQL Server, and use Append Queries to add the data records to
them, instead of Make-Table Queries to create them with data.
Larry Linson
Microsoft Office Access MVP
"Mourad" <mo************@gmail.comwrote in message
news:47**********************************@i76g2000 hsf.googlegroups.com...
Thanks, Lord Kelvan and lyle fairfield for your valuiable input,
It's really worth to converting the Make-Table to pass-through
queries, however, it's worth mentioning the following:
1- The Make-Tables queries already exists, there are simply hundreds
of them! As I mentioned earlier, I'm moving from Access 2.0 back-end
to SQL Server.
2- The Make-Table queries join both Tables and Queries! The joined
queries further join tables and queries, and so on! The joined tables
could reside in both SQL Server and/or the local Access MDB file!! I'm
not sure how the ODBC/SQL Server will handle this! but it's worth to
try!
3- Losing the Query Design view for Pass Through queries is a little
discouraging!
This is a part of migrating an existing application, that was designed
using Access/File Server framework.
I will give it a shot to see how Access will handle this.
Thanks again,
Mourad
Thanks Klatuu and Larry,
The motivation to move back-end to SQL Server is not mainly the file
size! The back-end is already split over many MDB file, with links to
front-end. I would say there are more than one motivation: one of them
is to get Access 2.0 and Access 2003 front-end applications to share
the same back-end data, which is version 2.0 mdb! For some reason we
are unable to run 2.0 and 2003 applications against the same 2.0 mdb
database!!! You may ask why don't upgrade all to 2003? Cannot! because
the application is huge, there are so many front and back-end's
databases, it is just too risky, and requires code freeze for a
while, ...etc. So one solution was to move the 2.0 back-end into SQL
Server, so front-end's applications connect using ODBC, and so we can
have 2.0 and 2003 apps share same data, then after that we can start
upgrade one front-end at a time. (sorry for the long details)
Larry,
I think Make-Table queries are a maintenance free approach! You don't
have to worry about any structure changes to the underlying joint
tables, things just work automatically. usually the tables created
using Make-Table query are temporary, in nature, that are used for
reports, ...etc. But I agree it also can be done using the Append
query, after deleting all rows!
I appreciate the tip for creating the right SQL syntax using both
Access and the Management studio.
Thanks,
Mourad
None of these invalidates my suggestion. If you use Enterprise Manager to
create the tables in SQL Server, and link them, you should have no problem
_appending_ the Access records to the SQL tables. And, that will serve
exactly the same purpose -- creating and populating the SQL Server tables
with the data that is currently in Access.
And, given that
(1) you have not been able to use Make-Table queries to create SQL Server
tables, and
(2) no one here seems to have done so,
you are quite possibly wasting every minute that you spend trying to find a
way to do what seems, on the surface to be "an easier way".
Access 2.0 is, long since, "out of support", and there are a number of other
reasons to bring it up-to-date. Wishing you did not have to expend time and
energy to avoid the problems isn't going to make them go away. You can work
around some of them, but at the expense of making use of Access 2.0 more
complex. I was very fond of Access 2.0, but unless you retain some old,
limited-memory machines, plan on running it under a Virtual Machine so you
can limit memory to a size Access 2.0 can handle.
Larry Linson
Microsoft Office Access MVP
"Mourad" <mo************@gmail.comwrote in message
news:c5**********************************@m45g2000 hsb.googlegroups.com...
Thanks Klatuu and Larry,
The motivation to move back-end to SQL Server is not mainly the file
size! The back-end is already split over many MDB file, with links to
front-end. I would say there are more than one motivation: one of them
is to get Access 2.0 and Access 2003 front-end applications to share
the same back-end data, which is version 2.0 mdb! For some reason we
are unable to run 2.0 and 2003 applications against the same 2.0 mdb
database!!! You may ask why don't upgrade all to 2003? Cannot! because
the application is huge, there are so many front and back-end's
databases, it is just too risky, and requires code freeze for a
while, ...etc. So one solution was to move the 2.0 back-end into SQL
Server, so front-end's applications connect using ODBC, and so we can
have 2.0 and 2003 apps share same data, then after that we can start
upgrade one front-end at a time. (sorry for the long details)
Larry,
I think Make-Table queries are a maintenance free approach! You don't
have to worry about any structure changes to the underlying joint
tables, things just work automatically. usually the tables created
using Make-Table query are temporary, in nature, that are used for
reports, ...etc. But I agree it also can be done using the Append
query, after deleting all rows!
I appreciate the tip for creating the right SQL syntax using both
Access and the Management studio.
Thanks,
Mourad
Thanks, larry, for the feed back,
Just wanted to make a correction, that, I actually COULD find the
right syntax to convert the Make-Table query to create the destination
table in SQL SQL Server! In addition, I've posted the syntax above so
it may benefit everyone! Here is it again:
"... set the query property "Dest Connect Str" to
"ODBC;DSN=DataSourceName;DATABASE=DBname;Trusted_C onnection=Yes;"
The result SQL query look like:
SELECT * INTO
[ODBC;DSN=DataSourceName;DATABASE=DBname;Trusted_Co nnection=Yes;].DstTable
FROM SrcTable;
Thanks again for your comments and feedback,
Mourad
I just tried
SELECT * INTO
[ODBC;DSN=DataSourceName;DATABASE=DBname;Trusted_Co nnection=Yes;].DstTab
le
FROM SrcTable;
Sub MakeServerTblUsingODBC()
Dim strSql As String
strSql = "SELECT * INTO [ODBC;DSN=myDSN;DATABASE=myDB;Trusted_Connection
=Yes;].DstTable FROM tbl1;"
DoCmd.RunSql strSql
End Sub
This worked perfectly. I guess I was incorrected about stating that you
could not do this with ODBC. I don't really use ODBC - thus, what do I
know? But this is very cool indeed. I guess ODBC can perform just
about all the actions that ADO can perform. My only issue is the
continuous connection.
Rich
*** Sent via Developersdex http://www.developersdex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rich N |
last post by:
I want to move several records from one table to a new table. My
database is set up so that there's the "regular" database, and the
".be" database. In which do I use the Make Table Query?
|
by: JJ |
last post by:
I have a Make Table query which uses a date parameter. Each time the
user runs the query they will be prompted for a date. The table which
is created should be named based on the date which they...
|
by: Oreo Bomb |
last post by:
I have a secured database that contains a Read-Only group. This group
has permissions to view reports, but cannot add, edit, or delete any
DB objects. One of the reports the group needs access to...
|
by: LesM |
last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002
SP3.
I have Progress table that is linked via ODBC into Access using OpenLink
Lite for Progress 9.0b. For over a year, using...
|
by: Doc |
last post by:
Per earlier post, I am trying to save 'out' production data from a
program called Solomon - basically (I think) this was /is an Access/Sql
based program.
We are updating to different application...
|
by: ken |
last post by:
Hi,
I use this command to run a make table query without opening it...
CurrentDb.Execute "make table query name"
Access tells me that it can't execute a select query...? Its a make
table query...
|
by: Laetitia Clark |
last post by:
Is it possible to force a Decimal type field from an ODBC source to
become a Double type field in the destination table when using a Make
Table query ?
Thanks in advance.
Laetitia
South...
|
by: Robertf987 |
last post by:
Hi, I'm a bit stuck with an access database. I'm using access 2000 if that's any help.
Right, it's 3:40am right now and I'm rather tired, but I *hope* this makes sense.
I have a table which...
|
by: arcingmad |
last post by:
Hi I am using the following code in a button click event to run a query stored in a .mdb file from an external geographic program ArcGIS via a jet adodb connection
I have the need to run an...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |