Re: Manuel for ODBC

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Carsten Bonde (bonde)
Date: 06/23/04


Date: Wed, 23 Jun 2004 11:53:34 +0200

Hoe,

i'm not aware of any functional differences.
The way you use DSN-Less connections is in code a little different.
lnHandle= SQLConnect("DSN-Name")
instead of
SQLStringConnect(ConnectionString)

In my previous example the connectionsstring is created on the fly. In that
case the program must know the password. If security is an issue, this might
be a reason to use a DSN.
Maybe DSN's are easier to use when you have a DBC (with remoteviews) or
CursorAdaptors. I have less expierence with that one.

Instead of setting up the connectionstring, you can use the API-Function
CreateDSN.
Goes like this:

<snip>
PROCEDURE CreateDsn
LOCAL settings

   DECLARE Integer SQLConfigDataSource in odbccp32.dll Integer, Integer,
String, String

   settings="DSN=TestMySQL"+chr(0)+;
             "Description=MySQL DSN"+chr(0)+;
             "DATABASE=test"+chr(0)+;
             "SERVER=192.168.100.254"+chr(0)+;
             "UID=username"+chr(0)+;
             "PASSWORD=secret"

  Note: OS <= Win98, use the old driver "MySQL", on other systems
  Note: use the current driver: "MySQL ODBC 3.51 Driver"
  IF OS(3) >= "5"
   =SQLConfigDataSource(0,1,"MySQL ODBC 3.51 Driver",settings)
  ELSE
   =SQLConfigDataSource(0,1,"MySQL",settings)
  ENDIF

<snip>

Cheers
Carsten

"tnhoe" <tnhoe@pc.jaring.my> schrieb im Newsbeitrag
news:cbbcf2$alc$1@news4.jaring.my...
> "Carsten Bonde"
>
> What is the different of ODBC DSN and DSN less connection on VFP/MySQL ?
>
> Regards
> Hoe
>
>



Relevant Pages

  • Re: SQL and Oracle Connections
    ... For an example of building a system DSN: ... For an example of programmatically changing the database in a DSN for SQL ... If you're bent on using VB instead of DSN's for your connections, ... > don't want to have to set up the data sources for each db. ...
    (microsoft.public.access.externaldata)
  • Re: ODBC connection failure
    ... I need the DSN to run Crystal Reports. ... the protocols don't ... connections, ... >> Would the easiest thing to do be revert back to Windows ...
    (microsoft.public.sqlserver.server)
  • Re: Creating Linked Table Without A DSN
    ... you can't do it through the GUI. ... "Matt Delfs" wrote in message ... > "DSNless" connections which is exactly how I want them. ... the key difference appears to be that the DSN connection DOES NOT ...
    (microsoft.public.access.externaldata)
  • Re: Cubas way of controlling the Internet
    ... In France the government has set up a scheme to use satellite connections ... cheaper as no fiber optics are needed.http://www.cisco.com/warp/public/cc/pd/witc/ao1200ap/prodlit/spab_bc.pdf ... STILL waiting for your Master Plan to provide internet access ...
    (soc.culture.cuba)
  • Re: spyware tcp connections from spoolsv.exe to internet!!!
    ... My "symptom" is that I'll see attempted connections from IP addresses ... in the Akamai range from their port 80 to my ports 10xx through 12xx. ... idiot (snip) ...
    (microsoft.public.security)