Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Object Pascal Programming Language
  • Page:
  • 1

TOPIC:

Memdataset loading blank records 1 year 5 months ago #17696

  • Jim
  • Jim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
I hope someone can help me. This is driving me crazy!
I have a MemTable database that loads from an html file via Readln.
The parsing works well, the strings load just right, but when it comes to adding it to the database it falls apart.
I use a standard Append, FieldValues :=, Post formula (see below). All the records are added (over 300) but they are all blank!
Here is what I have tried:

1. turned off the filter. No effect.
2. created a tiny version of the app that uses the same database type and structure. It works fine.
3. Tried loading a record directly in the Form.Create section. It too is blank.
4. Tried switching up with Insert instead of Append, and FieldByName instead of FieldValues. No change.

I really hope someone can help. I've done databases before and never run into this. I must have messed something up, but I can't see what.

Here is the code:


           if dbJWV.Lookup('dbfilename',Trim(getFileName),'dbfilename')=null then
               begin
               // add to the database
                dbJWV.Append;
                dbJWV.FieldValues := Trim(getType);
                //dbJWV.Fields[1].AsString:=Trim(getSpeaker);
                dbJWV.FieldValues := Trim(getShow);
                dbJWV.FieldValues := Trim(getTime);
                dbJWV.FieldValues := Trim(getTitle);
                dbJWV.FieldValues := Trim(getFileName);
               // if watchedINI.ReadBool(getFileName,'Watched',False)=True then
                 //  dbJWV.Fields[5].AsBoolean:=True
                   //  else
                       dbJWV.FieldValues := False;
                dbJWV.FieldValues := Trim(getPix);
                dbJWV.Post;
                countNew := countNew + 1;
               end;

Please Log in or Create an account to join the conversation.

Memdataset loading blank records 1 year 5 months ago #17697

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1086
  • Thank you received: 156
Any sample project for test ?
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Memdataset loading blank records 1 year 5 months ago #17698

  • Jim
  • Jim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Found the bug! ... Human stupidity, as usual... I had not set the size of the fields when I put them in, so they were all set to 0!!!
Many records containing 0-bit information. D'Oh!
Now I can move on.

Please Log in or Create an account to join the conversation.

Memdataset loading blank records 1 year 5 months ago #17699

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1086
  • Thank you received: 156
Thanks, have fun..
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1