Solved

From Access to MSSQLSERVER

Posted on 1998-05-29
6
187 Views
Last Modified: 2010-05-03
Using VB5, MSSQL server 6,5,   DAO
I have mdb database and linked with server exsisting empty table(dbo_cheque)I wanted to move table contents to MSSQL server
DAO
sql = "INSERT INTO dbo_cheque SELECT * FROM chequeproper;"
 db.Execute sql

I am getting error message 3070 : MS Jet does not recognize "aaaa"(my mdb fieldname) as a valid field name
I tried to use several field names over there, result the same.
Any help appreciated
0
Comment
Question by:mativare
6 Comments
 
LVL 9

Expert Comment

by:cymbolic
ID: 1462034
Your syntax needs to be:

Insert Into dbo_cheque (field1,field2,field3...) select fromfld1,fromfld2,fromfld3... from fromtabl [optional where clause]

You need to enumerate the fields inserted.  You need to have rights on the server.  You need to include all necessary key fields, foreign key constraints, not null fields etc to make it happen.
0
 
LVL 2

Expert Comment

by:marti
ID: 1462035
Be sure to have the same number and type of the fields in both dbo_cheque and chequeproper. They have to be at the same order as well for your Qry to be executed correctly.
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1462036
What you really need is the Access to SQL Upsizing tool from Microsoft.  
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:seahpc
ID: 1462037
Another way is to physically go to access and export the tables to MSSQL .
0
 
LVL 1

Author Comment

by:mativare
ID: 1462038
Ineresting
But I cannot use Upsizer in this case, because I insert data in run time, it means every time client enters row data to excel spreadsheet(linked to Access), it inserts row SQLserver too(linked via Access)
0
 

Accepted Solution

by:
eyaltil earned 50 total points
ID: 1462039
i think the problem is that the db connection cannot connect to two defrent databases in one time.
i think you shoud handle to database connections, do select in the first and do insert for the recordset u got in the second


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question