lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
539 stars 191 forks source link

About LuaSQL.ODBC #27

Open HernanCano opened 9 years ago

HernanCano commented 9 years ago

Hi.

I am interested in using LuaSQL.ODBC. How could I use a connectionstring for connecting to a database?

Thanks.

HERNAN CANO M. Systems Analyst - Programmer

tomasguisasola commented 9 years ago

Hi Hernan

I am interested in using LuaSQL.ODBC. How could I use a connectionstring for connecting to a database? Have you checked the examples? What was the problem?

Regards, Tomás

HernanCano commented 9 years ago

Hello. Yes, I have seen the examples, but it seems LuaSQL.ODBC were conceived for using a DSN, and I want to use a connection string, for not depending on create manually a DSN in Windows' Control Panel. Do you know if there is an alternative that can be used with a connection string instead of DSN? Thanks.

Date: Fri, 23 Jan 2015 09:48:30 -0800 From: notifications@github.com To: luasql@noreply.github.com CC: jhernancanom@hotmail.com Subject: Re: [luasql] About LuaSQL.ODBC (#27)

Hi Hernan

I am interested in using LuaSQL.ODBC. How could I use a

connectionstring for connecting to a database?

Have you checked the examples? What was the problem?

Regards,

Tomás

— Reply to this email directly or view it on GitHub.

                  =
tomasguisasola commented 9 years ago

Hi Hernan

I am not sure but I think you'll have to do both: create a DSN in Windows Control Panel AND use a connection string to identify the DSN... But I don't use ODBC since 2003; maybe I am wrong...

Regards, Tomás

On 2015-01-23 21:48, HernanCano wrote:

Hello. Yes, I have seen the examples, but it seems LuaSQL.ODBC were conceived for using a DSN, and I want to use a connection string, for not depending on create manually a DSN in Windows' Control Panel. Do you know if there is an alternative that can be used with a connection string instead of DSN? Thanks.

Date: Fri, 23 Jan 2015 09:48:30 -0800 From: notifications@github.com To: luasql@noreply.github.com CC: jhernancanom@hotmail.com Subject: Re: [luasql] About LuaSQL.ODBC (#27)

Hi Hernan

I am interested in using LuaSQL.ODBC. How could I use a

connectionstring for connecting to a database?

Have you checked the examples? What was the problem?

Regards,

Tomás

— Reply to this email directly or view it on GitHub.

=

Reply to this email directly or view it on GitHub

HernanCano commented 9 years ago

Hello. Friend: I program in VFP. We can use SQLCONNECT (that needs we create a DSN in Control Panel before using it) and SQLSTRINGCONNECT (that does not need we create a DSN for using it). I prefer SQLSTRINGCONNECT.

When I see LuaSQL sources in C language, I consider that I can "create" a new way (adjusting the original sources) and/or reprogram it for use a conection string... butI only suppose ... for my experience in programming. I look C/C++ sources for connection with a string and I find --for example--https://msdn.microsoft.com/es-es/library/office/ff965871(v=office.14).aspx#DataProgrammingWithAccess2010_DirectODBCExample http://www.easysoft.com/developer/languages/c/odbc_tutorial.html https://msdn.microsoft.com/es-es/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-7 But the original LuaSQL sources in C must be adjusted... the problem is that I am not very creative in C/C++... and that is why I look for help.... some another utility that can use a string for connection or an LuaSQL already optimized. If you know something that can share with me, God will bless you richly. Thanks, my friend. Date: Sat, 24 Jan 2015 06:42:01 -0800 From: notifications@github.com To: luasql@noreply.github.com CC: jhernancanom@hotmail.com Subject: Re: [luasql] About LuaSQL.ODBC (#27)

Hi Hernan

I am not sure but I think you'll have to do both: create a DSN in

Windows Control Panel AND use a connection string to identify the DSN...

But I don't use ODBC since 2003; maybe I am wrong...

Regards,

Tomás

                  =
tomasguisasola commented 9 years ago

Hi Hernan

Ok, I'll take a look at this, but now I am busy...

Regards, Tomás

On 2015-01-24 20:16, HernanCano wrote:

Hello. Friend: I program in VFP. We can use SQLCONNECT (that needs we create a DSN in Control Panel before using it) and SQLSTRINGCONNECT (that does not need we create a DSN for using it). I prefer SQLSTRINGCONNECT.

When I see LuaSQL sources in C language, I consider that I can "create" a new way (adjusting the original sources) and/or reprogram it for use a conection string... butI only suppose ... for my experience in programming. I look C/C++ sources for connection with a string and I find --for example--https://msdn.microsoft.com/es-es/library/office/ff965871(v=office.14).aspx#DataProgrammingWithAccess2010_DirectODBCExample

http://www.easysoft.com/developer/languages/c/odbc_tutorial.html

https://msdn.microsoft.com/es-es/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-7

But the original LuaSQL sources in C must be adjusted... the problem is that I am not very creative in C/C++... and that is why I look for help.... some another utility that can use a string for connection or an LuaSQL already optimized. If you know something that can share with me, God will bless you richly. Thanks, my friend. Date: Sat, 24 Jan 2015 06:42:01 -0800 From: notifications@github.com To: luasql@noreply.github.com CC: jhernancanom@hotmail.com Subject: Re: [luasql] About LuaSQL.ODBC (#27)

Hi Hernan

I am not sure but I think you'll have to do both: create a DSN in

Windows Control Panel AND use a connection string to identify the DSN...

But I don't use ODBC since 2003; maybe I am wrong...

Regards,

Tomás

=

Reply to this email directly or view it on GitHub

blumf commented 9 years ago

Take a look at my pull request #28

Allows passing a table to the env.connect method (old style of user,pswd,db still works too). You can specify the DSN directly there.

HernanCano commented 9 years ago

Ok, friend.It looks fine. I'll see it.That God bless you.By.

Date: Tue, 27 Jan 2015 05:31:52 -0800 From: notifications@github.com To: luasql@noreply.github.com CC: jhernancanom@hotmail.com Subject: Re: [luasql] About LuaSQL.ODBC (#27)

Take a look at my pull request #28

Allows passing a table to the env.connect method (old style of user,pswd,db still works too). You can specify the DSN directly there.

— Reply to this email directly or view it on GitHub.

                  =