IonicWind Software

IWBasic => Database => Topic started by: billhsln on March 19, 2010, 05:39:30 PM

Title: Trying to install data in table
Post by: billhsln on March 19, 2010, 05:39:30 PM
I am trying to load a MDB file with data from a tab delimited file.  I have tried it both ways that I have seen examples of, but it does not seem to be working.  It will create the table, but will not load any data.  I know I must be doing some thing wrong, I just don't see it.

Any help will be appreciated.

Thanks,
Bill
Title: Re: Trying to install data in table
Post by: LarryMc on March 19, 2010, 06:36:18 PM
Bill

hstmt_insert = dbExecSQL(pdb,ctStmt)
You opened the database with pdbx and you're trying to insert into pdb which isn't open.

LarryMc

EDIT: After looking carefully at your code I see that you had that correct the way you wrote it.
Title: Re: Trying to install data in table
Post by: billhsln on March 19, 2010, 08:47:57 PM
Thanks, Larry.  This now comes up with a 42000 error on the insert.  So, still not able to insert data into the table.  I have created the table manually, but would still like to know how to do it thru the program.

Still would appreciate any help getting the data to be loaded.  Will also load a 5 record sample.

Thanks,
Bill
Title: Re: Trying to install data in table
Post by: LarryMc on March 19, 2010, 09:16:54 PM
trying to get a virsu off my grand-daughter's computer.
will look at you problem when I get through

Larry
Title: Re: Trying to install data in table
Post by: billhsln on March 19, 2010, 11:22:22 PM
I was searching thru some of the replys in this section and came across a note about field names not being the same as key words.   I was using SET as a table name.  Changed it to CardSet and it inserts without any problems.

Just thought I would give out how I found and fixed the problem.

Thanks again, Larry.

As you might be able to tell, I am working on a Cataloging program for my 8 year old Grandson's Pokemon collection.

Take care,
Bill
Title: Re: Trying to install data in table
Post by: LarryMc on March 20, 2010, 12:14:46 AM
I had found that but I was looking at some other stuff too.

Anyway, glad you found it.  You also have to becareful with using columns with fixed sizes and then using STRING variables in your program.

Seems like the feild names are cae sensitive but I might just be dreaming that.

You weren't using dbFreeSQL right before the endwhile like you need to.

Just remember that for every hstmt = dbExecSQL(pdbx,ctStmt)
you have to have a dbFreeSQL( hstmt )
before you can have another hstmt = dbExecSQL(pdbx,ctStmt)


LarryMc
Title: Re: Trying to install data in table
Post by: billhsln on March 20, 2010, 02:58:51 AM
Thanks, Larry.  Your answer caught a problem before I was able to post it.  The program was only allowing 680 inserts and then it quit.  Putting in the dbFreeSQL command fixed that problem and it now enters the entire 4,890 records.

Thanks again,
Bill