472,802 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,802 software developers and data experts.

Table structure and data transfer from SQL2000 to Access (.mdb)

jc
Hello. I want to ask about the possibility of copying both a table
structure and it's contents from a
SQL server table to a table within MS access. The problem cannot be
solve with a permanent table structure at the target location.
The names of the columns are essentially data with the application and
so are subject to change. I am targeting a solution using SQL Query
Manager.

The approach I have tried (with failure) is
SELECT *
INTO <linkedserver table>
FROM <local table>

This should create and copy. However, I am not sure if this is
achievable with this approach.

Refer to the dialogue;
-------------------------------------------------------
USE MASTER
GO
EXEC sp_addlinkedserver
@SERVER = 'Freddie',
@PROVIDER = 'Microsoft.Jet.OLEDB.4.0',
@SRVPRODUCT = 'OLE DB Provider for Jet',
@DATASRC = 'C:\temp\HMIS_Recipe.mdb'

-- I am not sure if this is required
EXEC sp_addlinkedsrvlogin 'Freddie', false, 'sa', 'Admin', NULL

SELECT * FROM Freddie...FRED -- This is OK

SELECT * INTO #Temp FROM Freddie...FRED -- This is OK

-- This fails - Refer error
SELECT * INTO Freddie.FRED65
from #temp

Server: Msg 2760, Level 16, State 1, Line 1
Specified owner name 'Freddie' either does not exist or you do not have
permission to use it.

-- This also fails and I thought reflected the above select with naming
- Refer error
SELECT * INTO Freddie...FRED65
from #temp

Server: Msg 117, Level 15, State 1, Line 2
The object name 'Freddie...' contains more than the maximum number of
prefixes. The maximum is 2.

EXEC sp_dropserver 'Freddie',
@droplogins = 'droplogins'

------------------------------------------------------------

Thank you.

Regards JC...

Aug 7 '06 #1
3 2439
jc (jc********@aanet.com.au) writes:
Hello. I want to ask about the possibility of copying both a table
structure and it's contents from a
SQL server table to a table within MS access. The problem cannot be
solve with a permanent table structure at the target location.
The names of the columns are essentially data with the application and
so are subject to change. I am targeting a solution using SQL Query
Manager.

The approach I have tried (with failure) is
SELECT *
INTO <linkedserver table>
FROM <local table>

This should create and copy. However, I am not sure if this is
achievable with this approach.
While this will copy some of the table properties, it will not carry
over indexes etc. So I don't think that this is a good start. You
should probably get script with CREATE TABLE statemnets that also
include definitions of constraints, keys indexes etc. Bare in mind that
Access and SQL Server are quite different, so you may have to do changes
along the way.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 8 '06 #2
jc

Hi.
My basic problem with the initial posting is that I can read tables
from the linked server (the Access .mdb) but cannot create a table with
the "SELECT * INTO table" statement.

Regards JC....

Aug 9 '06 #3
jc (jc********@aanet.com.au) writes:
My basic problem with the initial posting is that I can read tables
from the linked server (the Access .mdb) but cannot create a table with
the "SELECT * INTO table" statement.
Yeah, the point with my post is that even if you could it would only take
you half-way, so I don't think is a viable route.

But I see now that I misread your message (was tired last night). I figured
you wanted to copy tables from Access to SQL Server when you in fact want
to do it in the opposite direction. And I'm afraid that's an even deader
end. How would SQL Server be able to create tables on an entirely different
engine? The linked server may even be a non-relational data source.

You may want to look at the Import/Export wizards. I have never used them
myself, though.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Morgan | last post by:
------=_NextPart_000_0009_01C3535E.C763E5F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm doing a project for a local hospital, they want to...
0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
0
by: hai99 | last post by:
hello, i create a new datatable by code and want to store this table in an access-mdb. there is a lot stuff about to select data from an access-mdb and pass the result to a datatable. but i...
1
by: DataB | last post by:
Hi Everyone! I have, essentially, two table structures in the same ms access database file. Both are of the parent-child format, one parent table with personal details, then multiple child...
2
by: tekanet | last post by:
Hello folks, I'm developing a program that reads an access MDB file and produce some scripts to rebuild the same structure against other databases (MSSQL, MySQL and so on). Reading structure...
2
by: Andy Davis | last post by:
Has anybody tried and had any success exporting data directly from ACT! 2000 to an Access database? I need to transfer data from ACT! to Access, but the data is all imported as text, including date...
0
by: Vikram Attiganal | last post by:
Hi, I need to know the table structure of an MS-Access database. I tried Desc table sql and it doesnt seem to work. Is there any other method to know the structure of a table. I need to know it from...
3
by: genojoe | last post by:
I have tried everything I can think of to move records from one Access database to another. It should not be that hard. Read on.... I have identical access mdb's. One contains data; one...
6
by: okan | last post by:
Hi everyone. My question is that i have a form which includes subform,too. in this form for example i choose a country and in the subform its capital, currency,president are shown. and i have a...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.