ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 22nd, 2009, 03:45 AM
mrt mrt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 mrt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 19 sec
Reputation Power: 0
"Data source name not found and no default driver specified" err for VFP ODBC driver

Hello,
I have to integrate an older COM library with an ASP.NET application. The library loads Fox Pro DBF files into a MSSQL database. The call to the libraryís main method results in the following error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The library works fine with the old ASP site and also works fine when called from a .Net console application.
I presumed that the error was due to insufficient rights of the ASPNET user account and I tried to impersonate my current user account which is member of the Administrator group (the old ASP application uses Windows Authentication). It didnít work, neither with impersonation at web.config level, nor with impersonation at page level using the Win 32 LogonUser method.
I tested the library using vbs scripts and the runas command line utility and I got the following results:
1. The piece of code causing the trouble is (the error is thrown when the connection opens):
Code:
Dim sConnString 
sConnString = "DSN=Visual FoxPro Tables;" & _
                  "SourceDB=C:\Temp;" & _
                  "SourceType=DBF;" & _
                  "Database=DBFTestFile;"
Set oConnDBF = CreateObject("ADODB.Connection")
oConnDBF.Open sConnString

2. The code works only under my current user account (it does not work even under the Administrator account)
3. The code works fine for any user when I use the /noprofile argument of the runas utility
From that I deduct that the error is not due to missing security permissions, but to the Windows profile of the user under which the code executes (that explains why impersonation doesnít work). Maybe this has something to do with the fact that the Visual Fox Pro ODBC driver has been discontinued since MDAC version 2.6. I have installed MDAC 2.6 over MDAC 2.8 because the library explicitly required this version. The installation was carried out under my account and maybe the driver seems to be not installed for the other accounts.
I checked the registry key for the ODBC driver (HKLM/Software/ODBC) and the permissions granted on it were fine, so this is not the problem.
Thanks for any advice

Reply With Quote
  #2  
Old October 22nd, 2009, 06:01 AM
mrt mrt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 mrt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 19 sec
Reputation Power: 0
Problem solved,

Stupid me, because the library documentation said nothing about creating a data source, I presumed the connection string was DSN-less and I didn't even look at it.
The "Visual FoxPro Tables" and "Visual FoxPro Database" DSN's were automatically created, perhaps upon VS 98 installation. I have 2 computers on which they are created as User DSN and one on which are they are created as both user and system DSN's.
I've created identical system DSN's and now everything works.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > "Data source name not found and no default driver specified" err for VFP ODBC driver


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap