Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Dalton Calford via use-livecode
Thanks Bob, very helpful.

On Wed, 3 Jul 2019 at 11:42, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Maybe a little more useful as a complete function:
>
> function dbConnectODBCByString pServer, pDatabase, pUser, pPasswd
>switch the platform
>   case "MacOS"
>  get revOpenDatabase("ODBC","Driver={Actual SQLServer};Server=" &
> pServer & ";Database=pDataBase;UID=" & pUser & ";PWD= & pPasswd & ";",,,)
>  break
>   case "Win32"
>  put
> listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") into
> tOdbcDrivers
>  switch
> case "SQL Server Native Client 11.0" is in tOdbcDrivers
>get revOpenDatabase("ODBC","DRIVER={SQL Server Native
> Client11.0};SERVER=" & pServer & ";DATABASE=pDataBase;UID=" & pUser &
> ";PWD=" & pPasswd & ";Trusted_Connection=No",,,)
>break
> case "SQL Server Native Client 10.0" is in tOdbcDrivers
>get revOpenDatabase("ODBC","DRIVER={SQL Server Native
> Client10.0};SERVER=" & pServer & ";DATABASE=pDataBase;UID=" & pUser &
> ";PWD=" & pPasswd & ";Trusted_Connection=No",,,)
>break
> case "SQL Server" is in tOdbcDrivers
>get revOpenDatabase("ODBC","DRIVER={SQLServer};SERVER=" &
> pServer & ";DATABASE=pDataBase;UID=" & pUser & ";PWD=" & pPasswd &
> ";Trusted_Connection=No",,,)
>break
>  end switch
>  break
>end switch
>return it
> end dbConnectODBCByString
>
> Bob S
>
>
> > On Jul 3, 2019, at 08:22 , Dalton Calford via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Wonderful!  Thanks Matthias!
> >
> > I can ensure the ODBC drivers are in, that is not an issue.   Most of my
> > testing will be for linux anyways.
> >
> > Best regards
> >
> > Dalton
> >
> >
> > On Wed, 3 Jul 2019 at 11:09, Matthias Rebbe via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Hi Dalton,
> >>
> >> yes it is. You can use SQL Connection strings for it. But in any case
> >> you´ll need to have ODBC drivers installed.
> >>
> >> This here is an old script i used to query the installed Windows ODBC
> >> drivers and do the connection with Connection strings.
> >> It´s old and was registry check was used under Windows 32bit. But the
> >> Connectionstrings still should do with one exception.
> >>
> >> This does not work with new versions of LC on Mac. The latest Mac
> version
> >> which worked with SQL Connection strings was 6.7.11.
> >> Here´s the bug report from 2016
> >> https://quality.livecode.com/show_bug.cgi?id=18151 <
> >> https://quality.livecode.com/show_bug.cgi?id=18151>
> >>
> >>
> >> And here´s the script
> >> -- connection strings Win/Mac with check which Windows SQL ODBC drivers
> >> are installed
> >>
> >> switch the platform
> >>
> >> case "MacOS"
> >>
> >> get revOpenDatabase("ODBC","Driver={Actual SQL
> >>
> Server};Server=192.168.1.250;Database=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;",,,)
> >>
> >> break
> >>
> >> case "Win32"
> >>
> >> put listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") into
> >> tOdbcDrivers
> >>
> >> switch
> >>
> >> case "SQL Server Native Client 11.0" is in tOdbcDrivers
> >>
> >> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
> >>
> 11.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
> >>
> >> break
> >>
> >> case "SQL Server Native Client 10.0" is in tOdbcDrivers
> >>
> >> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
> >>
> 10.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
> >>
> >> break
> >>
> >> case "SQL Server" is in tOdbcDrivers
> >>
> >> get revOpenDatabase("ODBC","DRIVER={SQL
> >>
> Server};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
> >>
> >> break
> >>
> >> end switch
> >>
> >> break
> >>
> >> end switch
> >>
> >> Regards,
> >>
> >> Matthias
> >>
> >>
> >>
> >> Matthias Rebbe
> >>
> >> free tools for Livecoders:
> >> https://instamaker.dermattes.de 
> >> https://winsignhelper.dermattes.de  >
> >>> Am 03.07.2019 um 16:42 schrieb Dalton Calford via use-livecode <
> >> use-livecode@lists.runrev.com >:
> >>>
> >>> Is it possible to connect to a database without a predefined DSN using
> >> the
> >>> livecode database connector?
> >>>
> >>> best regards
> >>>
> >>> Dalton
> >>> ___
> >>> use-livecode mailing list
> >>> use-livecode@lists.runrev.com 
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecod

Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Bob Sneidar via use-livecode
Maybe a little more useful as a complete function:

function dbConnectODBCByString pServer, pDatabase, pUser, pPasswd
   switch the platform
  case "MacOS"
 get revOpenDatabase("ODBC","Driver={Actual SQLServer};Server=" & 
pServer & ";Database=pDataBase;UID=" & pUser & ";PWD= & pPasswd & ";",,,)
 break
  case "Win32"
 put listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") 
into tOdbcDrivers
 switch
case "SQL Server Native Client 11.0" is in tOdbcDrivers
   get revOpenDatabase("ODBC","DRIVER={SQL Server Native 
Client11.0};SERVER=" & pServer & ";DATABASE=pDataBase;UID=" & pUser & ";PWD=" & 
pPasswd & ";Trusted_Connection=No",,,)
   break
case "SQL Server Native Client 10.0" is in tOdbcDrivers
   get revOpenDatabase("ODBC","DRIVER={SQL Server Native 
Client10.0};SERVER=" & pServer & ";DATABASE=pDataBase;UID=" & pUser & ";PWD=" & 
pPasswd & ";Trusted_Connection=No",,,)
   break
case "SQL Server" is in tOdbcDrivers
   get revOpenDatabase("ODBC","DRIVER={SQLServer};SERVER=" & 
pServer & ";DATABASE=pDataBase;UID=" & pUser & ";PWD=" & pPasswd & 
";Trusted_Connection=No",,,)
   break
 end switch
 break
   end switch
   return it
end dbConnectODBCByString

Bob S


> On Jul 3, 2019, at 08:22 , Dalton Calford via use-livecode 
>  wrote:
> 
> Wonderful!  Thanks Matthias!
> 
> I can ensure the ODBC drivers are in, that is not an issue.   Most of my
> testing will be for linux anyways.
> 
> Best regards
> 
> Dalton
> 
> 
> On Wed, 3 Jul 2019 at 11:09, Matthias Rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi Dalton,
>> 
>> yes it is. You can use SQL Connection strings for it. But in any case
>> you´ll need to have ODBC drivers installed.
>> 
>> This here is an old script i used to query the installed Windows ODBC
>> drivers and do the connection with Connection strings.
>> It´s old and was registry check was used under Windows 32bit. But the
>> Connectionstrings still should do with one exception.
>> 
>> This does not work with new versions of LC on Mac. The latest Mac version
>> which worked with SQL Connection strings was 6.7.11.
>> Here´s the bug report from 2016
>> https://quality.livecode.com/show_bug.cgi?id=18151 <
>> https://quality.livecode.com/show_bug.cgi?id=18151>
>> 
>> 
>> And here´s the script
>> -- connection strings Win/Mac with check which Windows SQL ODBC drivers
>> are installed
>> 
>> switch the platform
>> 
>> case "MacOS"
>> 
>> get revOpenDatabase("ODBC","Driver={Actual SQL
>> Server};Server=192.168.1.250;Database=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;",,,)
>> 
>> break
>> 
>> case "Win32"
>> 
>> put listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") into
>> tOdbcDrivers
>> 
>> switch
>> 
>> case "SQL Server Native Client 11.0" is in tOdbcDrivers
>> 
>> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
>> 11.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>> 
>> break
>> 
>> case "SQL Server Native Client 10.0" is in tOdbcDrivers
>> 
>> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
>> 10.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>> 
>> break
>> 
>> case "SQL Server" is in tOdbcDrivers
>> 
>> get revOpenDatabase("ODBC","DRIVER={SQL
>> Server};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>> 
>> break
>> 
>> end switch
>> 
>> break
>> 
>> end switch
>> 
>> Regards,
>> 
>> Matthias
>> 
>> 
>> 
>> Matthias Rebbe
>> 
>> free tools for Livecoders:
>> https://instamaker.dermattes.de 
>> https://winsignhelper.dermattes.de 
>>> Am 03.07.2019 um 16:42 schrieb Dalton Calford via use-livecode <
>> use-livecode@lists.runrev.com >:
>>> 
>>> Is it possible to connect to a database without a predefined DSN using
>> the
>>> livecode database connector?
>>> 
>>> best regards
>>> 
>>> Dalton
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com 
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/

Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Dalton Calford via use-livecode
Wonderful!  Thanks Matthias!

I can ensure the ODBC drivers are in, that is not an issue.   Most of my
testing will be for linux anyways.

Best regards

Dalton


On Wed, 3 Jul 2019 at 11:09, Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Dalton,
>
> yes it is. You can use SQL Connection strings for it. But in any case
> you´ll need to have ODBC drivers installed.
>
> This here is an old script i used to query the installed Windows ODBC
> drivers and do the connection with Connection strings.
> It´s old and was registry check was used under Windows 32bit. But the
> Connectionstrings still should do with one exception.
>
> This does not work with new versions of LC on Mac. The latest Mac version
> which worked with SQL Connection strings was 6.7.11.
> Here´s the bug report from 2016
> https://quality.livecode.com/show_bug.cgi?id=18151 <
> https://quality.livecode.com/show_bug.cgi?id=18151>
>
>
> And here´s the script
> -- connection strings Win/Mac with check which Windows SQL ODBC drivers
> are installed
>
> switch the platform
>
> case "MacOS"
>
> get revOpenDatabase("ODBC","Driver={Actual SQL
> Server};Server=192.168.1.250;Database=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;",,,)
>
> break
>
> case "Win32"
>
> put listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") into
> tOdbcDrivers
>
> switch
>
> case "SQL Server Native Client 11.0" is in tOdbcDrivers
>
> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
> 11.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>
> break
>
> case "SQL Server Native Client 10.0" is in tOdbcDrivers
>
> get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client
> 10.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>
> break
>
> case "SQL Server" is in tOdbcDrivers
>
> get revOpenDatabase("ODBC","DRIVER={SQL
> Server};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)
>
> break
>
> end switch
>
> break
>
> end switch
>
> Regards,
>
> Matthias
>
>
>
> Matthias Rebbe
>
> free tools for Livecoders:
> https://instamaker.dermattes.de 
> https://winsignhelper.dermattes.de 
> > Am 03.07.2019 um 16:42 schrieb Dalton Calford via use-livecode <
> use-livecode@lists.runrev.com >:
> >
> > Is it possible to connect to a database without a predefined DSN using
> the
> > livecode database connector?
> >
> > best regards
> >
> > Dalton
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com 
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Dalton Calford via use-livecode
Hi Bob,
This is a shame that this not is part of the ODBC implementation in
Livecode.
Many different languages allow for passing all the dsn information in the
connection string.For example, DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=C:\path\to\eft.mdb; or Provider=MSDASQL;DRIVER={MySQL ODBC
3.51
Driver};SERVER=10.10.10.1;DATABASE=Example;UID=myusername;PWD=mypassword;
Most of the drivers I use are opensource and don't require a fee, but even
if they did, I would gladly pay if they gave my clients connectivity (as
long as the price is reasonable). Does anyone have a pointer to where in
the opensource codebase for livecode, I can find the revopendatabase and
associated libraries? I have not had time to download/review the codebase
and it would be helpful to get an idea of where the code is and a pointer
to any possible documentation for when I start investigating it.

best regards

Dalton


On Wed, 3 Jul 2019 at 10:53, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Not to my mind as ODBC relies upon an intermediary service to actually
> make the connection. I don't use ODBC mainly because I would typically have
> to purchase an agent for whatever database engine I am trying to connect
> to, and that has typically been a non-starter for any in house projects I
> want to use.
>
> That being said, I believe it is the only way Livecode can communicate
> with a Microsoft SQL server, as well as Access, FoxPro, Excel etc.
>
> Bob S
>
>
> > On Jul 3, 2019, at 07:42 , Dalton Calford via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Is it possible to connect to a database without a predefined DSN using
> the
> > livecode database connector?
> >
> > best regards
> >
> > Dalton
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Matthias Rebbe via use-livecode
Hi Dalton,

yes it is. You can use SQL Connection strings for it. But in any case you´ll 
need to have ODBC drivers installed. 

This here is an old script i used to query the installed Windows ODBC drivers 
and do the connection with Connection strings.
It´s old and was registry check was used under Windows 32bit. But the 
Connectionstrings still should do with one exception.

This does not work with new versions of LC on Mac. The latest Mac version which 
worked with SQL Connection strings was 6.7.11.
Here´s the bug report from 2016 
https://quality.livecode.com/show_bug.cgi?id=18151 



And here´s the script
-- connection strings Win/Mac with check which Windows SQL ODBC drivers are 
installed

switch the platform

case "MacOS"

get revOpenDatabase("ODBC","Driver={Actual SQL 
Server};Server=192.168.1.250;Database=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;",,,)

break

case "Win32"

put listregistry("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\") into 
tOdbcDrivers

switch

case "SQL Server Native Client 11.0" is in tOdbcDrivers

get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client 
11.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)

break

case "SQL Server Native Client 10.0" is in tOdbcDrivers

get revOpenDatabase("ODBC","DRIVER={SQL Server Native Client 
10.0};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)

break

case "SQL Server" is in tOdbcDrivers

get revOpenDatabase("ODBC","DRIVER={SQL 
Server};SERVER=192.168.1.250;DATABASE=MyDatabaseName;UID=sa;PWD=MyDatabasePassword;Trusted_Connection=No",,,)

break

end switch

break

end switch

Regards,

Matthias



Matthias Rebbe

free tools for Livecoders:
https://instamaker.dermattes.de 
https://winsignhelper.dermattes.de 
> Am 03.07.2019 um 16:42 schrieb Dalton Calford via use-livecode 
> mailto:use-livecode@lists.runrev.com>>:
> 
> Is it possible to connect to a database without a predefined DSN using the
> livecode database connector?
> 
> best regards
> 
> Dalton
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Livecode ODBC connection without DSN?

2019-07-03 Thread Bob Sneidar via use-livecode
Not to my mind as ODBC relies upon an intermediary service to actually make the 
connection. I don't use ODBC mainly because I would typically have to purchase 
an agent for whatever database engine I am trying to connect to, and that has 
typically been a non-starter for any in house projects I want to use. 

That being said, I believe it is the only way Livecode can communicate with a 
Microsoft SQL server, as well as Access, FoxPro, Excel etc. 

Bob S


> On Jul 3, 2019, at 07:42 , Dalton Calford via use-livecode 
>  wrote:
> 
> Is it possible to connect to a database without a predefined DSN using the
> livecode database connector?
> 
> best regards
> 
> Dalton


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Livecode ODBC connection without DSN?

2019-07-03 Thread Dalton Calford via use-livecode
Is it possible to connect to a database without a predefined DSN using the
livecode database connector?

best regards

Dalton
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode