Index
2017-11-15 18:14 – Paul H. Tarver : SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-15 22:58 – Paul H. Tarver : RE: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 03:21 – AndyHC : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 05:25 – Ted Roche : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 05:26 – Dave Crozier : RE: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 05:41 – AndyHC : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 07:57 – Ted Roche : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 08:21 – Ted Roche : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 08:37 – Ted Roche : Re: SQLite Problem - DSN-less Connection Doesn't Create A File
2017-11-16 08:39 – Paul H. Tarver : RE: SQLite Problem - DSN-less Connection Doesn't Create A File
Back to top
SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Paul H. Tarver

Posted: 2017-11-15 18:14:04   Link

Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

some weird behavior going on.

I'm trying to use SQLite3 to deal with an import file that will have 350+

columns. I've been using the the examples and doing everything via the

SQLite3.exe command prompt works as documented. I've also worked out a SQL

script using SQLite Expert to drop a table if it exists, create an empty

table and the corresponding indexes. Up to this point everything worked as

expected.

However, now I'm trying to migrate this code into VFP9 using SQL

Pass-Through, but here's what I'm running into:

If I create a DSN using the ODBC drive and then use SQLCONNECT('dsn-name'),

the connection is made and if the database file "trnslate.db" doesn't

already exist it is created in the folder I designated in the Database Name

field of the DSN.

However, if I create DSN-Less connection (SQLSTRINGCONNECT) using the

connection string I get back using SQLGETPROP(lnhandle,"ConnectString") , I

get a handle, but it is to a "trnslate.db" database that doesn't contain the

table I previously created and if the "trnslate.db" table doesn't already

exist in the designated folder, it is NOT created on the hard drive.

However, it apparently IS created in memory. I can create a table and issue

a select command and get back the results I expect, but a database file is

NEVER physically created on the hard drive which I need to do for my

purposes.

Here is some sample code to see if you can tell me where I'm going wrong:

liH = SQLSTRINGCONNECT( "DRIVER=SQLite3 ODBC Driver;" + ;

"DBNAME=T:\trnslate.db;" + ;

"PWD=;" + ;

"StepAPI=0;" + ;

"SyncPragma=;" + ;

"NoTXN=0;" + ;

"Timeout=;" + ;

"ShortNames=0;" + ;

"LongNames=0;" + ;

"NoCreat=0;" + ;

"NoWCHAR=0;" + ;

"FKSupport=0;" + ;

"JournalMode=;" + ;

"OEMCP=0;" + ;

"BigInt=0;" + ;

"JDConv=0;" + ;

"TraceFile=;")

SQLExec(m.liH, "create table EmplImport (id int primary key, dummy

varchar(50));")

SQLExec(m.liH, "insert into EmplImport (id, dummy) values (1,'testing');")

SQLExec(m.liH, "select * from EmplImport;",'dbtest')

SQLDISCONNECT(liH)

I've tried this process about hundred differ ways with different

combinations of paired keys in the connection string without success. I've

used a DSN-less connection program that I wrote which works perfectly with

SQL, MySQL and others and though I never fail to get a handle; the database

file never physically exists in any path on the hard drive. Complete

searches of my hard drive for the database name yield no results

The code above gives me a value for m.liH which is greater than zero, I

never get errors thrown, I always get a valid handle, the table can be

created, the data inserted and I get a cursor back from the select named

'dbtest' with the exact data inserted on the previous line.

I've been on this for about six hours and I'm no closer to making this work

as a DSN-less project even though Whil seemed to imply in the book that this

was his preferred method of doing things.

HELP!

Paul H. Tarver

Email: <mailto:paul@tpcqpc.com> paul@tpcqpc.com

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/05cd01d35e6f$d017d540$70477fc0$@tpcqpc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Paul H. Tarver
Back to top
RE: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Paul H. Tarver

Posted: 2017-11-15 22:58:15   Link

New details.

I rebooted my computer and tried to use SQLSTRINGCONNECT again and this

time, a window opened which is the same window you would see if you try to

create a DSN. So I have no idea why I got a valid handle no matter what I

tried earlier because after the reboot, nothing I try will give me anything

other than the SQLite3 ODBC Driver Connect window.

I simplified the connection string command to this:

liH = SQLSTRINGCONNECT("DRIVER={SQLite3 ODBC

Driver};DBNAME=T:\f1;SyncPragma=NORMAL;Timeout=100000;")

Executing this line immediately opens the SQLite3 ODBC Driver Connect

window. The Data Source Name is blank and the Database Name is blank. The

timeout and the Synch Mode fields are populated with 100000 and NORMAL but I

have no idea if those are defaults or coming from the connection string.

If it helps, I'm using the 32-bit ODBC driver on a 64-bit Windows 7

development box.

PS: T:\ is a valid volume and I have also tried c:\temp\f1.

Paul H. Tarver

Email: paul@tpcqpc.com

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul H.

Tarver

Sent: Wednesday, November 15, 2017 6:14 PM

To: profoxtech@leafe.com

Subject: SQLite Problem - DSN-less Connection Doesn't Create A File

Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

some weird behavior going on.

I'm trying to use SQLite3 to deal with an import file that will have 350+

columns. I've been using the the examples and doing everything via the

SQLite3.exe command prompt works as documented. I've also worked out a SQL

script using SQLite Expert to drop a table if it exists, create an empty

table and the corresponding indexes. Up to this point everything worked as

expected.

However, now I'm trying to migrate this code into VFP9 using SQL

Pass-Through, but here's what I'm running into:

If I create a DSN using the ODBC drive and then use SQLCONNECT('dsn-name'),

the connection is made and if the database file "trnslate.db" doesn't

already exist it is created in the folder I designated in the Database Name

field of the DSN.

However, if I create DSN-Less connection (SQLSTRINGCONNECT) using the

connection string I get back using SQLGETPROP(lnhandle,"ConnectString") , I

get a handle, but it is to a "trnslate.db" database that doesn't contain the

table I previously created and if the "trnslate.db" table doesn't already

exist in the designated folder, it is NOT created on the hard drive.

However, it apparently IS created in memory. I can create a table and issue

a select command and get back the results I expect, but a database file is

NEVER physically created on the hard drive which I need to do for my

purposes.

Here is some sample code to see if you can tell me where I'm going wrong:

liH = SQLSTRINGCONNECT( "DRIVER=SQLite3 ODBC Driver;" + ;

"DBNAME=T:\trnslate.db;" + ;

"PWD=;" + ;

"StepAPI=0;" + ;

"SyncPragma=;" + ;

"NoTXN=0;" + ;

"Timeout=;" + ;

"ShortNames=0;" + ;

"LongNames=0;" + ;

"NoCreat=0;" + ;

"NoWCHAR=0;" + ;

"FKSupport=0;" + ;

"JournalMode=;" + ;

"OEMCP=0;" + ;

"BigInt=0;" + ;

"JDConv=0;" + ;

"TraceFile=;")

SQLExec(m.liH, "create table EmplImport (id int primary key, dummy

varchar(50));")

SQLExec(m.liH, "insert into EmplImport (id, dummy) values (1,'testing');")

SQLExec(m.liH, "select * from EmplImport;",'dbtest')

SQLDISCONNECT(liH)

I've tried this process about hundred differ ways with different

combinations of paired keys in the connection string without success. I've

used a DSN-less connection program that I wrote which works perfectly with

SQL, MySQL and others and though I never fail to get a handle; the database

file never physically exists in any path on the hard drive. Complete

searches of my hard drive for the database name yield no results

The code above gives me a value for m.liH which is greater than zero, I

never get errors thrown, I always get a valid handle, the table can be

created, the data inserted and I get a cursor back from the select named

'dbtest' with the exact data inserted on the previous line.

I've been on this for about six hours and I'm no closer to making this work

as a DSN-less project even though Whil seemed to imply in the book that this

was his preferred method of doing things.

HELP!

Paul H. Tarver

Email: <mailto:paul@tpcqpc.com> paul@tpcqpc.com

--- StripMime Report -- processed MIME parts --- multipart/alternative

text/plain (text body -- kept)

text/html

---

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/00a601d35e97$84340270$8c9c0750$@tpcqpc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Paul H. Tarver
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: AndyHC

Posted: 2017-11-16 03:21:56   Link

Have you checked:

https://www.connectionstrings.com/sqlite/

https://www.connectionstrings.com/sqlite3-odbc-driver/

On 16-Nov-2017 5:44 AM, Paul H. Tarver wrote:

> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

> The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

> some weird behavior going on.

>

>

>

> I'm trying to use SQLite3 to deal with an import file that will have 350+

> columns. I've been using the the examples and doing everything via the

> SQLite3.exe command prompt works as documented. I've also worked out a SQL

> script using SQLite Expert to drop a table if it exists, create an empty

> table and the corresponding indexes. Up to this point everything worked as

> expected.

>

>

>

> However, now I'm trying to migrate this code into VFP9 using SQL

> Pass-Through, but here's what I'm running into:

>

>

>

> If I create a DSN using the ODBC drive and then use SQLCONNECT('dsn-name'),

> the connection is made and if the database file "trnslate.db" doesn't

> already exist it is created in the folder I designated in the Database Name

> field of the DSN.

>

>

>

> However, if I create DSN-Less connection (SQLSTRINGCONNECT) using the

> connection string I get back using SQLGETPROP(lnhandle,"ConnectString") , I

> get a handle, but it is to a "trnslate.db" database that doesn't contain the

> table I previously created and if the "trnslate.db" table doesn't already

> exist in the designated folder, it is NOT created on the hard drive.

> However, it apparently IS created in memory. I can create a table and issue

> a select command and get back the results I expect, but a database file is

> NEVER physically created on the hard drive which I need to do for my

> purposes.

>

>

>

> Here is some sample code to see if you can tell me where I'm going wrong:

>

>

>

> liH = SQLSTRINGCONNECT( "DRIVER=SQLite3 ODBC Driver;" + ;

>

> "DBNAME=T:\trnslate.db;" + ;

>

> "PWD=;" + ;

>

> "StepAPI=0;" + ;

>

> "SyncPragma=;" + ;

>

> "NoTXN=0;" + ;

>

> "Timeout=;" + ;

>

> "ShortNames=0;" + ;

>

> "LongNames=0;" + ;

>

> "NoCreat=0;" + ;

>

> "NoWCHAR=0;" + ;

>

> "FKSupport=0;" + ;

>

> "JournalMode=;" + ;

>

> "OEMCP=0;" + ;

>

> "BigInt=0;" + ;

>

> "JDConv=0;" + ;

>

> "TraceFile=;")

>

>

>

> SQLExec(m.liH, "create table EmplImport (id int primary key, dummy

> varchar(50));")

>

> SQLExec(m.liH, "insert into EmplImport (id, dummy) values (1,'testing');")

>

> SQLExec(m.liH, "select * from EmplImport;",'dbtest')

>

>

>

> SQLDISCONNECT(liH)

>

>

>

> I've tried this process about hundred differ ways with different

> combinations of paired keys in the connection string without success. I've

> used a DSN-less connection program that I wrote which works perfectly with

> SQL, MySQL and others and though I never fail to get a handle; the database

> file never physically exists in any path on the hard drive. Complete

> searches of my hard drive for the database name yield no results

>

>

>

> The code above gives me a value for m.liH which is greater than zero, I

> never get errors thrown, I always get a valid handle, the table can be

> created, the data inserted and I get a cursor back from the select named

> 'dbtest' with the exact data inserted on the previous line.

>

>

>

> I've been on this for about six hours and I'm no closer to making this work

> as a DSN-less project even though Whil seemed to imply in the book that this

> was his preferred method of doing things.

>

>

>

> HELP!

>

>

>

> Paul H. Tarver

> Email: <mailto:paul@tpcqpc.com> paul@tpcqpc.com

>

>

>

>

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/b1dbf046-cf35-f3bc-809b-e2815088223d@hawthorncottage.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 AndyHC
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Ted Roche

Posted: 2017-11-16 05:25:11   Link

On Wed, Nov 15, 2017 at 7:14 PM, Paul H. Tarver <paul@tpcqpc.com> wrote:

> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

> The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

> some weird behavior going on.

I read that book, too! <g>

> If I create a DSN using the ODBC drive and then use SQLCONNECT('dsn-name'),

> the connection is made and if the database file "trnslate.db" doesn't

> already exist it is created in the folder I designated in the Database Name

> field of the DSN.

That's good.

> However, if I create DSN-Less connection (SQLSTRINGCONNECT) using the

> connection string I get back using SQLGETPROP(lnhandle,"ConnectString") , I

> get a handle, but it is to a "trnslate.db" database that doesn't contain the

> table I previously created and if the "trnslate.db" table doesn't already

> exist in the designated folder, it is NOT created on the hard drive.

> However, it apparently IS created in memory. I can create a table and issue

> a select command and get back the results I expect, but a database file is

> NEVER physically created on the hard drive which I need to do for my

> purposes.

/*snip*/

> HELP!

I'm away from Windows machines right now. Let me check into this later

in the day.

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CACW6n4u_HHAeZZSLhDJ3iCVek3ii5LXh+OLKVOe3XKW8asq1aA@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Ted Roche
Back to top
RE: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Dave Crozier

Posted: 2017-11-16 05:26:40   Link

Paul,

Have you tried forcing a Commit on the SQLite data. That may help

Dave

---------------------------------------------------------------

This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any

attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

Flexipol Packaging Ltd.

Unit 14 Bentwood Road

Carrs

Industrial Estate

Haslingden

Rossendale

Lancashire

BB4 5HH

Tel:01706-222792

Fax: 01706-224683

www.Flexipol.co.uk

---------------------------------------------------------------

Terms & Conditions:

Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller

Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time

-----Original Message-----

From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Paul H. Tarver

Sent: 16 November 2017 04:58

To: profox@leafe.com

Subject: RE: SQLite Problem - DSN-less Connection Doesn't Create A File

New details.

I rebooted my computer and tried to use SQLSTRINGCONNECT again and this time, a window opened which is the same window you would see if you try to create a DSN. So I have no idea why I got a valid handle no matter what I tried earlier because after the reboot, nothing I try will give me anything other than the SQLite3 ODBC Driver Connect window.

I simplified the connection string command to this:

liH = SQLSTRINGCONNECT("DRIVER={SQLite3 ODBC

Driver};DBNAME=T:\f1;SyncPragma=NORMAL;Timeout=100000;")

Executing this line immediately opens the SQLite3 ODBC Driver Connect window. The Data Source Name is blank and the Database Name is blank. The timeout and the Synch Mode fields are populated with 100000 and NORMAL but I have no idea if those are defaults or coming from the connection string.

If it helps, I'm using the 32-bit ODBC driver on a 64-bit Windows 7 development box.

PS: T:\ is a valid volume and I have also tried c:\temp\f1.

Paul H. Tarver

Email: paul@tpcqpc.com

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul H.

Tarver

Sent: Wednesday, November 15, 2017 6:14 PM

To: profoxtech@leafe.com

Subject: SQLite Problem - DSN-less Connection Doesn't Create A File

Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have some weird behavior going on.

I'm trying to use SQLite3 to deal with an import file that will have 350+ columns. I've been using the the examples and doing everything via the SQLite3.exe command prompt works as documented. I've also worked out a SQL script using SQLite Expert to drop a table if it exists, create an empty table and the corresponding indexes. Up to this point everything worked as expected.

However, now I'm trying to migrate this code into VFP9 using SQL Pass-Through, but here's what I'm running into:

If I create a DSN using the ODBC drive and then use SQLCONNECT('dsn-name'), the connection is made and if the database file "trnslate.db" doesn't already exist it is created in the folder I designated in the Database Name field of the DSN.

However, if I create DSN-Less connection (SQLSTRINGCONNECT) using the connection string I get back using SQLGETPROP(lnhandle,"ConnectString") , I get a handle, but it is to a "trnslate.db" database that doesn't contain the table I previously created and if the "trnslate.db" table doesn't already exist in the designated folder, it is NOT created on the hard drive.

However, it apparently IS created in memory. I can create a table and issue a select command and get back the results I expect, but a database file is NEVER physically created on the hard drive which I need to do for my purposes.

Here is some sample code to see if you can tell me where I'm going wrong:

liH = SQLSTRINGCONNECT( "DRIVER=SQLite3 ODBC Driver;" + ;

"DBNAME=T:\trnslate.db;" + ;

"PWD=;" + ;

"StepAPI=0;" + ;

"SyncPragma=;" + ;

"NoTXN=0;" + ;

"Timeout=;" + ;

"ShortNames=0;" + ;

"LongNames=0;" + ;

"NoCreat=0;" + ;

"NoWCHAR=0;" + ;

"FKSupport=0;" + ;

"JournalMode=;" + ;

"OEMCP=0;" + ;

"BigInt=0;" + ;

"JDConv=0;" + ;

"TraceFile=;")

SQLExec(m.liH, "create table EmplImport (id int primary key, dummy

varchar(50));")

SQLExec(m.liH, "insert into EmplImport (id, dummy) values (1,'testing');")

SQLExec(m.liH, "select * from EmplImport;",'dbtest')

SQLDISCONNECT(liH)

I've tried this process about hundred differ ways with different combinations of paired keys in the connection string without success. I've used a DSN-less connection program that I wrote which works perfectly with SQL, MySQL and others and though I never fail to get a handle; the database file never physically exists in any path on the hard drive. Complete searches of my hard drive for the database name yield no results

The code above gives me a value for m.liH which is greater than zero, I never get errors thrown, I always get a valid handle, the table can be created, the data inserted and I get a cursor back from the select named 'dbtest' with the exact data inserted on the previous line.

I've been on this for about six hours and I'm no closer to making this work as a DSN-less project even though Whil seemed to imply in the book that this was his preferred method of doing things.

HELP!

Paul H. Tarver

Email: <mailto:paul@tpcqpc.com> paul@tpcqpc.com

--- StripMime Report -- processed MIME parts --- multipart/alternative

text/plain (text body -- kept)

text/html

---

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/00a601d35e97$84340270$8c9c0750$@tpcqpc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB2B48E1CA4@EX2010-A-FPL.FPL.LOCAL

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Dave Crozier
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: AndyHC

Posted: 2017-11-16 05:41:58   Link

+1

On 16-Nov-2017 4:56 PM, Dave Crozier wrote:

> Paul,

> Have you tried forcing a Commit on the SQLite data. That may help

>

> Dave

>

>

>

> ---------------------------------------------------------------

>

<snip>

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/52e2eca5-c282-e40e-82cf-ed7541e74623@hawthorncottage.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 AndyHC
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Ted Roche

Posted: 2017-11-16 07:57:34   Link

On Thu, Nov 16, 2017 at 6:25 AM, Ted Roche <tedroche@gmail.com> wrote:

> On Wed, Nov 15, 2017 at 7:14 PM, Paul H. Tarver <paul@tpcqpc.com> wrote:

>> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

>> The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

>> some weird behavior going on.

>

Having worked with Whil on a half-dozen books now, I have to say,

weird behavior is par for the course. ;)

Here's what I did. I called up a DSN I had previously created and like

you, copied the ConnectString when it opened. The only big difference

I notice is that my string is using "Database" rather than DBNAME.

? SQLStringConnect("Driver={SQLite3 ODBC

Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPragma=;NoTXN=0;Timeout=;ShortNames=0;")

? SQLExec(4, "Create table Example2 (key int, description text)")

? SQLExec(4, "insert into Example2 (key, description) values (1,'The first')")

? SQLExec(4, "insert into Example2 (key, description) values (2,'The second')")

the "newexample.sqlite" database did not exist before I started. It's

on disk now, at 8 kb.

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CACW6n4vCogaC5bt69+H3zG=H1afoHbXtVBxAYDjk76Rbz1jMNQ@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Ted Roche
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Ted Roche

Posted: 2017-11-16 08:21:12   Link

And:

? SQLDisconnect(0)

? SQLStringConnect("Driver={SQLite3 ODBC

Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPragma=;NoTXN=0;Timeout=;ShortNames=0;")

? SQLExec(1,"Select * from Example2")

brow norm

disconnects all ODBC connections, reconnects, and shows the two

records in the table, so that's working.

On Thu, Nov 16, 2017 at 8:57 AM, Ted Roche <tedroche@gmail.com> wrote:

> On Thu, Nov 16, 2017 at 6:25 AM, Ted Roche <tedroche@gmail.com> wrote:

>> On Wed, Nov 15, 2017 at 7:14 PM, Paul H. Tarver <paul@tpcqpc.com> wrote:

>>> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

>>> The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

>>> some weird behavior going on.

>>

>

> Having worked with Whil on a half-dozen books now, I have to say,

> weird behavior is par for the course. ;)

>

> Here's what I did. I called up a DSN I had previously created and like

> you, copied the ConnectString when it opened. The only big difference

> I notice is that my string is using "Database" rather than DBNAME.

>

> ? SQLStringConnect("Driver={SQLite3 ODBC

> Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPragma=;NoTXN=0;Timeout=;ShortNames=0;")

> ? SQLExec(4, "Create table Example2 (key int, description text)")

> ? SQLExec(4, "insert into Example2 (key, description) values (1,'The first')")

> ? SQLExec(4, "insert into Example2 (key, description) values (2,'The second')")

>

>

> the "newexample.sqlite" database did not exist before I started. It's

> on disk now, at 8 kb.

>

> --

> Ted Roche

> Ted Roche & Associates, LLC

> http://www.tedroche.com

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CACW6n4smOyLqNoqhkrbFr=RmFUk7gOOAO87fV2rmCNUxnNKuPQ@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Ted Roche
Back to top
Re: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Ted Roche

Posted: 2017-11-16 08:37:01   Link

>From https://sqlite.org/cli.html :

"If no database file is specified on the command-line, a temporary

database is created, then deleted when the "sqlite3" program exits."

I'll bet that's what you are seeing, only using the ODBC driver rather

than the command line: a temporary database created and deleted, like

a cursor.

On Thu, Nov 16, 2017 at 9:21 AM, Ted Roche <tedroche@gmail.com> wrote:

> And:

>

> ? SQLDisconnect(0)

> ? SQLStringConnect("Driver={SQLite3 ODBC

> Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPragma=;NoTXN=0;Timeout=;ShortNames=0;")

> ? SQLExec(1,"Select * from Example2")

> brow norm

>

> disconnects all ODBC connections, reconnects, and shows the two

> records in the table, so that's working.

>

>

>

> On Thu, Nov 16, 2017 at 8:57 AM, Ted Roche <tedroche@gmail.com> wrote:

>> On Thu, Nov 16, 2017 at 6:25 AM, Ted Roche <tedroche@gmail.com> wrote:

>>> On Wed, Nov 15, 2017 at 7:14 PM, Paul H. Tarver <paul@tpcqpc.com> wrote:

>>>> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to Bypass

>>>> The 2GB .DBF Filesize Limit" for a project I'm trying to develop and I have

>>>> some weird behavior going on.

>>>

>>

>> Having worked with Whil on a half-dozen books now, I have to say,

>> weird behavior is par for the course. ;)

>>

>> Here's what I did. I called up a DSN I had previously created and like

>> you, copied the ConnectString when it opened. The only big difference

>> I notice is that my string is using "Database" rather than DBNAME.

>>

>> ? SQLStringConnect("Driver={SQLite3 ODBC

>> Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPragma=;NoTXN=0;Timeout=;ShortNames=0;")

>> ? SQLExec(4, "Create table Example2 (key int, description text)")

>> ? SQLExec(4, "insert into Example2 (key, description) values (1,'The first')")

>> ? SQLExec(4, "insert into Example2 (key, description) values (2,'The second')")

>>

>>

>> the "newexample.sqlite" database did not exist before I started. It's

>> on disk now, at 8 kb.

>>

>> --

>> Ted Roche

>> Ted Roche & Associates, LLC

>> http://www.tedroche.com

>

>

>

> --

> Ted Roche

> Ted Roche & Associates, LLC

> http://www.tedroche.com

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CACW6n4tX1+Yn7iv32ayhuN08C5mHkmgh3+FUSj-KDvNLRjuhVw@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Ted Roche
Back to top
RE: SQLite Problem - DSN-less Connection Doesn't Create A File

Author: Paul H. Tarver

Posted: 2017-11-16 08:39:35   Link

Ok, I formally nominate Ted Roche to be VFP King and SQLite Guru! All those

in favor? :)

I changed "DBNAME" in the connection string to "Database" and it worked

perfectly the first time.

I knew it was going to be something stupid, but I didn't realize it was THAT

stupid. I can only claim programming blindness. I looked at the string in

Whil's book a thousand times and compared it to my code and never saw it.

I've been doing a lot of work lately connecting Foxpro to MySQL for another

project and DBNAME came over from that connection string. Of all the changes

I made to the connection string, I never changed, deleted or replaced the

Driver & DBAME key words. I changed everything else from the other key pairs

to the location and name of the database, but I am embarrassed to say I

never looked to the left of the equal sign to see the bad key word. Around

here they say, "If it had been a snake, it would have bit me."

One weird thing remains: As I mentioned in the original post, prior to

rebooting my computer, I NEVER got an error message and I always got a valid

handle back when I tried to make a connection and I was able to create

tables, insert data and select results. I can only assume it was because

SQLite allows you to create an in-memory database with a blank name, maybe

that was how I got a valid handle, but why did it fail to repeat that

behavior after the reboot? Was it because I established a valid DSN earlier

in testing and somehow it was piggy-backing on that connection? As I say,

weird.

Thank you Ed for providing the ProFox list. Without this place I don't know

how long it would have taken me to figure this issue out if ever.

Paul H. Tarver

Tarver Program Consultants, Inc.

Tel: 601-483-4404

Email: paul@tpcqpc.com

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted

Roche

Sent: Thursday, November 16, 2017 7:58 AM

To: profoxtech@leafe.com

Subject: Re: SQLite Problem - DSN-less Connection Doesn't Create A File

On Thu, Nov 16, 2017 at 6:25 AM, Ted Roche <tedroche@gmail.com> wrote:

> On Wed, Nov 15, 2017 at 7:14 PM, Paul H. Tarver <paul@tpcqpc.com> wrote:

>> Ok, I give up. I've been using Whil Hentzen's book "Using SQLite to

>> Bypass The 2GB .DBF Filesize Limit" for a project I'm trying to

>> develop and I have some weird behavior going on.

>

Having worked with Whil on a half-dozen books now, I have to say, weird

behavior is par for the course. ;)

Here's what I did. I called up a DSN I had previously created and like you,

copied the ConnectString when it opened. The only big difference I notice is

that my string is using "Database" rather than DBNAME.

? SQLStringConnect("Driver={SQLite3 ODBC

Driver};Database=C:\Users\tedro\Documents\newexample.sqlite;StepAPI=0;SyncPr

agma=;NoTXN=0;Timeout=;ShortNames=0;")

? SQLExec(4, "Create table Example2 (key int, description text)") ?

SQLExec(4, "insert into Example2 (key, description) values (1,'The first')")

? SQLExec(4, "insert into Example2 (key, description) values (2,'The

second')")

the "newexample.sqlite" database did not exist before I started. It's on

disk now, at 8 kb.

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/002f01d35ee8$b9366610$2ba33230$@tpcqpc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2017 Paul H. Tarver