Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 23rd, 2003, 05:22 PM
nayak nayak is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 nayak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Data source name not found and no default dr

Hello,

I am trying to copy the tables from MSaccess database to other database given the source database DSn name(ex:AccountInfo) and the destination database DSN name(GPSMData1).

In the following code I have hard coded dest DSN name to be GPSMData1. also, for testing purpose my destination database is also mdb file.

CDatabase db;
b.OpenEx("DSN="+ srcDSNname);
CString sql = "SELECT accounts.* INTO[ODBC;DSN='GPSMData1';UID='Admin';PWD=].accounts FROM accounts;" ;
db.ExecuteSQL (sql) ;
db.Close();

I have no problem connecting to src DSN when I use MFC's CDatabase class function OpenEx("DSN="+ srcDSNname). But got following error message displayed in log at ExecuteSQL():
[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

I pasted the above sql query in my src database, Account.mdb, i got the same error. just for the heck for it, I went to my destination database GPSMdata.mdb, and rearranged my SQl such that:

SELECT accounts.* INTO accounts FROM [ODBC;DSN='AccountInfo';UID='Admin';PWD=].accounts;"

again the same error as above.... seems okay to connect via MFC's CDatabase but not via this query....


Please help ....................
thx...

Reply With Quote
  #2  
Old September 25th, 2003, 11:27 PM
Jimdogee Jimdogee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Brick City, NJ, USA
Posts: 11 Jimdogee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Jimdogee Send a message via Yahoo to Jimdogee
If you are using windows, try creating a System DSN entry in the ODBC Data Source applet found in the Control Panel for both MSAcccess .mdb files., and what progr. lang. r u using ?ASP.Net,C#,etc???

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Data source name not found and no default dr


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT