?
Solved

From Access to MSSQLSERVER

Posted on 1998-05-29
6
Medium Priority
?
194 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 100 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

807 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