Solved

From Access to MSSQLSERVER

Posted on 1998-05-29
6
183 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now