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 ---
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]
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$@tpcqp... ** 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.
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]
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.
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.
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
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
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]
Ted is, and always has been, a King amongst VFP men and women. 😊
In the wondrous world of computer programming, not only do words have meaning but so do individual letters. And let's not get started on case sensitivity... I've been bitten by something like this before as I'm sure most of us have. The efficient brain takes shortcuts whenever possible so if you expected to see a particular thing in a particular context, it shows that to you.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul H. Tarver Sent: Thursday, November 16, 2017 9:40 AM To: profoxtech@leafe.com Subject: RE: SQLite Problem - DSN-less Connection Doesn't Create A File
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
Yep. I've seen this video before and Change Blindness still bit me in the butt:
The good news is apparently I'm in the 50% group...:)
Paul H. Tarver Email: paul@tpcqpc.com
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Thursday, November 16, 2017 8:45 AM To: profoxtech@leafe.com Subject: RE: SQLite Problem - DSN-less Connection Doesn't Create A File
Ted is, and always has been, a King amongst VFP men and women. 😊
In the wondrous world of computer programming, not only do words have meaning but so do individual letters. And let's not get started on case sensitivity... I've been bitten by something like this before as I'm sure most of us have. The efficient brain takes shortcuts whenever possible so if you expected to see a particular thing in a particular context, it shows that to you.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul H. Tarver Sent: Thursday, November 16, 2017 9:40 AM To: profoxtech@leafe.com Subject: RE: SQLite Problem - DSN-less Connection Doesn't Create A File
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]
On Thu, Nov 16, 2017 at 9:39 AM, Paul H. Tarver paul@tpcqpc.com wrote:
Ok, I formally nominate Ted Roche to be VFP King and SQLite Guru! All those in favor? :)
Aw, shucks.
"If nominated, I shall not run. If elected, I shall not serve." -- LBJ
"It's good to be king." -- Mel Brooks, The 2000 Year Old Man.
I'm just the editor of the SQLite book doing a little CYA to make sure I hadn't lead anyone astray.
Around here they say, "If it had been a snake, it would have bit me."
It's been my experience fixing my own and other's stuff that we're really good at getting the complicated stuff right, and really bad at finding the misplaced semi-colon or mistyped command.
One weird thing remains:
"Have you tried turning it off and back on again" -- The IT Group
It's almost impossible to guess. Perhaps you had an ON ERROR * in code you ran two days ago. It's always helpful to turn the machine off and on, and to try to reproduce with as few lines of code as possible, and on a different machine if possible.
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.
Hear, hear!
Years ago when I was in college, I worked as a Lab Assistant in the computer lab (TRS-80, CoCo's and Kaypro computers, BTW!) . Every student on campus was required to take an intro to computer programming course and our job as Lab Assistants was to assist students of all different backgrounds and fields of study work out their programming issues from this class.
One of the first rules was "Don't solve their problem TOO fast!" If a Lab Assistant walked over to a student who had been in the lab for 6 hours struggling to overcome a syntax error and we walked over and immediately pointed out the comma in the wrong place, the struggling student might get angry enough to just get up and walk out. However, if we took a little bit of time to locate the problem and asked them lots of questions about what they were trying to accomplish and THEN we pointed out the errant comma, they accepted our correction more easily and their pride was still intact and they didn't get too frustrated with the whole concept of programming.
Somehow yesterday I forgot to look for an "errant comma".
PS: Thank you Ted for not solving my problem TOO fast! I might just stay with Foxpro for another 25 years. :)
Paul H. Tarver
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Thursday, November 16, 2017 9:05 AM To: profoxtech@leafe.com Subject: Re: SQLite Problem - DSN-less Connection Doesn't Create A File
On Thu, Nov 16, 2017 at 9:39 AM, Paul H. Tarver paul@tpcqpc.com wrote:
Ok, I formally nominate Ted Roche to be VFP King and SQLite Guru! All those in favor? :)
Aw, shucks.
"If nominated, I shall not run. If elected, I shall not serve." -- LBJ
"It's good to be king." -- Mel Brooks, The 2000 Year Old Man.
I'm just the editor of the SQLite book doing a little CYA to make sure I hadn't lead anyone astray.
Around here they say, "If it had been a snake, it would have bit me."
It's been my experience fixing my own and other's stuff that we're really good at getting the complicated stuff right, and really bad at finding the misplaced semi-colon or mistyped command.
One weird thing remains:
"Have you tried turning it off and back on again" -- The IT Group
It's almost impossible to guess. Perhaps you had an ON ERROR * in code you ran two days ago. It's always helpful to turn the machine off and on, and to try to reproduce with as few lines of code as possible, and on a different machine if possible.
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.
Hear, hear!
-- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com
[excessive quoting removed by server]
/"It's good to be the king." -- Mel Brooks/ History of the World Part 1. Crucial movie in my formative early teens.
On Thu, Nov 16, 2017 at 9:04 AM, Ted Roche tedroche@gmail.com wrote:
On Thu, Nov 16, 2017 at 9:39 AM, Paul H. Tarver paul@tpcqpc.com wrote:
Ok, I formally nominate Ted Roche to be VFP King and SQLite Guru! All
those
in favor? :)
Aw, shucks.
"If nominated, I shall not run. If elected, I shall not serve." -- LBJ
"It's good to be king." -- Mel Brooks, The 2000 Year Old Man.
I'm just the editor of the SQLite book doing a little CYA to make sure I hadn't lead anyone astray.
Around here they say, "If it had been a snake, it would have bit me."
It's been my experience fixing my own and other's stuff that we're really good at getting the complicated stuff right, and really bad at finding the misplaced semi-colon or mistyped command.
One weird thing remains:
"Have you tried turning it off and back on again" -- The IT Group
It's almost impossible to guess. Perhaps you had an ON ERROR * in code you ran two days ago. It's always helpful to turn the machine off and on, and to try to reproduce with as few lines of code as possible, and on a different machine if possible.
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.
Hear, hear!
-- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com
[excessive quoting removed by server]
On Fri, Nov 17, 2017 at 11:45 AM, Eric Selje eric.selje@gmail.com wrote:
/"It's good to be the king." -- Mel Brooks/ History of the World Part 1. Crucial movie in my formative early teens.
That's right. Remembered the actor, misremembered the movie. 2k was actually a comedy album (vinyl, kids!) of Brooks and Reiner.
On 2017-11-17 11:45, Eric Selje wrote:
/"It's good to be the king." -- Mel Brooks/ History of the World Part
Crucial movie in my formative early teens.
Thanks, Eric. That's where I had heard that quote too. Love the Mel Brooks movies (although he probably couldn't get away with that in today's over-sensitive environment!)
Yep, no way in hell Blazing Saddles gets made today.
"Mongo no go. Mongo stay with Sheriff Bart. Sheriff Bart first man ever whip Mongo. Mongo impressed. Have deep feelings for Sheriff Bart."
Paul H. Tarver
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Friday, November 17, 2017 2:11 PM To: profoxtech@leafe.com Subject: Re: SQLite Problem - DSN-less Connection Doesn't Create A File
On 2017-11-17 11:45, Eric Selje wrote:
/"It's good to be the king." -- Mel Brooks/ History of the World Part
Crucial movie in my formative early teens.
Thanks, Eric. That's where I had heard that quote too. Love the Mel Brooks movies (although he probably couldn't get away with that in today's over-sensitive environment!)
[excessive quoting removed by server]
If you've seen the Borat movies, or Ted, or South Park, you'll see that offensive movies still get made and are still pretty hilarious.
On Fri, Nov 17, 2017 at 2:43 PM, Paul H. Tarver paul@tpcqpc.com wrote:
Yep, no way in hell Blazing Saddles gets made today.
"Mongo no go. Mongo stay with Sheriff Bart. Sheriff Bart first man ever whip Mongo. Mongo impressed. Have deep feelings for Sheriff Bart."
Paul H. Tarver
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Friday, November 17, 2017 2:11 PM To: profoxtech@leafe.com Subject: Re: SQLite Problem - DSN-less Connection Doesn't Create A File
On 2017-11-17 11:45, Eric Selje wrote:
/"It's good to be the king." -- Mel Brooks/ History of the World Part
Crucial movie in my formative early teens.
Thanks, Eric. That's where I had heard that quote too. Love the Mel Brooks movies (although he probably couldn't get away with that in today's over-sensitive environment!)
[excessive quoting removed by server]
On 2017-11-17 16:56, Eric Selje wrote:
If you've seen the Borat movies, or Ted, or South Park, you'll see that offensive movies still get made and are still pretty hilarious.
Ted was hilarious but I don't remember too many edgy "politically incorrect" non-sexual things in it. SouthPark for sure presses (and crosses!) the line. Didn't see the Borat movies. They looked stupid (and not Naked Gun or Airplane kind of stupid--which I love) to me.
Beaver's mom speaking jive still cracks me up! Best casting ever!
Paul
PS: And don't call me Shirley!
Sent from my iPhone
On Nov 17, 2017, at 4:44 PM, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
On 2017-11-17 16:56, Eric Selje wrote: If you've seen the Borat movies, or Ted, or South Park, you'll see that offensive movies still get made and are still pretty hilarious.
Ted was hilarious but I don't remember too many edgy "politically incorrect" non-sexual things in it. SouthPark for sure presses (and crosses!) the line. Didn't see the Borat movies. They looked stupid (and not Naked Gun or Airplane kind of stupid--which I love) to me.
[excessive quoting removed by server]
On 2017-11-17 15:43, Paul H. Tarver wrote:
Yep, no way in hell Blazing Saddles gets made today.
"Mongo no go. Mongo stay with Sheriff Bart. Sheriff Bart first man ever whip Mongo. Mongo impressed. Have deep feelings for Sheriff Bart."
And you quoted the least offensive probably parts! "The Sheriff is a N<bell chime>!" And "Where are all the white women at?" etc etc etc
lol
It's actually funny. I was looking at a list of 50 or 69 quotes from Blazing Saddles and all of them had me cracking up at my desk. I picked the Mongo quote because I love Mongo but also because I wasn't sure how far off the trail to take this group. You never know these days.
Paul
PS: I didn't get a harumpf outta that guy!
Sent from my iPhone
On Nov 17, 2017, at 4:42 PM, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
On 2017-11-17 15:43, Paul H. Tarver wrote: Yep, no way in hell Blazing Saddles gets made today. "Mongo no go. Mongo stay with Sheriff Bart. Sheriff Bart first man ever whip Mongo. Mongo impressed. Have deep feelings for Sheriff Bart."
And you quoted the least offensive probably parts! "The Sheriff is a N<bell chime>!" And "Where are all the white women at?" etc etc etc
lol
[excessive quoting removed by server]