Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Jerzy Kopinski
  Where is Jerzy Kopinski?
 Pruszcz Gdanski
 Poland
 Jerzy Kopinski
 Tags
Subject: RE: Def. ODBC data source FROM VFP Apps
Thread ID: 395943 Message ID: 396000 # Views: 36 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Win32API programming
Date: Wednesday, January 22, 2014 8:27:23 AM         
   


> Hi Stefan,
> Thanks for your reply and suggestions. As I understand you connect to SQL Server directly without ODBC using SQLStringConnection(). Did you encounter any problems under Win 7/8?
> Sincerely,
> Jerzy
>
>
> > Hi Jerzy,
> >
> > As a guess, at first glance ODBC_ADD_SYS_DSN looks suspicious, assuming that in your context the current process might have standard privileges (Win Vista/7/8 with UAC turned on (default)), so that creating a "System DSN" might fail, whereas a "User DSN" would perhaps not.
> >
> > (FWIW, personally I never seriously tried to create ODBC "Data Source Names" in a real production project, because using SqlStringConnect() instead of SqlConnect() is so much easier and straight-forward.)
> >
> >
> >
> >
> > hth
> > -Stefan


SqlStringConnect() is also using an ODBC driver, but as opposed to SqlConnect() it does not need a so called "Data Source Name" DSN.
Where the DSN item is just a place in Windows Registry where some info are being stored on things like driver, server name, initial database etc.
That same info is written in the string that you would use as a SqlStringConnect() parameter, e.g.
lnConnection = SqlStringConnect("DRIVER=SQL Server;SERVER=...



> Did you encounter any problems under Win 7/8?

No, in general Win7/8 do not behave differently than WinXP with a so called "limited" account.
(FWIW, there is a difference when it comes to 32bit vs 64bit Windows systems, but that's more about those DSNs that SqlStringConnect() would not need, where the DSNs for 32bit drivers are not in the standard "ODBC administration" dialog in Win 64bit but in a secondary one being hidden as C:\Windows\SysWOW64\odbcad32.exe)



hth
-Stefan

ENTIRE THREAD

Def. ODBC data source FROM VFP Apps Posted by Jerzy Kopinski @ 1/21/2014 5:36:44 PM
RE: Def. ODBC data source FROM VFP Apps Posted by Stefan Wuebbe @ 1/21/2014 5:58:47 PM
RE: Def. ODBC data source FROM VFP Apps Posted by Jerzy Kopinski @ 1/22/2014 7:34:23 AM
RE: Def. ODBC data source FROM VFP Apps Posted by Stefan Wuebbe @ 1/22/2014 8:27:23 AM
RE: Def. ODBC data source FROM VFP Apps Posted by Jerzy Kopinski @ 1/22/2014 8:52:22 AM
RE: Def. ODBC data source FROM VFP Apps Posted by Jerzy Kopinski @ 1/22/2014 8:36:09 AM
RE: Def. ODBC data source FROM VFP Apps Posted by Stefan Wuebbe @ 1/22/2014 9:08:24 AM
RE: Def. ODBC data source FROM VFP Apps Posted by tom knauf @ 1/23/2014 1:23:01 PM