Nil RecordSet

Are you lost Calvin ?

In the shared code (in the Open Event ?), you have:

dim dr as new DatabaseRecord dr = new DatabaseRecord

Not the source of your trouble, but useless.

And, unless DB is declared elsewhere, it is not declared in the Event (as everyone already stated).

You may have to take a break and come back to your code later with a fresh brain. This works for me, sometimes.

Calvin, I’m new to Xojo and SQLite. I have never used SQLite as a file/link like you are trying to do on your app.

I used this information/webinar and the examples included with Xojo to start.

See Paul’s video and follow the steps, I’m sure that you will be able to make it work.

And as a totally unrelated issue. It looks like this table contains PHI (Patient Health Information, data that directly identifies a person, via Name/SocSecNum/Medicare Number). I hope you realize that you need to provide the proper level security so that data meets the required HIPPA standards, and is only accessible by authorized persons.

@Dave S yes I do understand the HIPPA standards of personal data. Social Security Number will be limited to only the last 4 as which is provided to our agents from the home offices to identify their clients as well as the medicare number starting april 1 will no longer be a social security number with a letter but a group of letters and numbers to identify a medicare patient. that is why this is not going to be released to anyone until i get all of the correct safety precautions handled.

How many times to we have to state this before you answer this simple question? Where and how is the database object DB initialized? The rest of the comments are irrelevant at this point. The problem is not that the recordset is Nil. The problem is that DB is Nil.

To put it another way:

When and how do you CONNECT to the database?

He has answered that question. As you can see by his screenshot above, he added the db to his project in the IDE. Unfortunately, that process is very fragile and has come back to bite him.

Calvin, your problem is that the IDE has lost contact with your database and is no longer able to connect to it. I would recommend that you cease using that mechanism and connect to your database in code rather than relying on the IDE to handle that for you. It’s very tempting to go the IDE route, but unfortunately, it doesn’t work very well.

[quote=374388:@Tim Hare]He has answered that question. As you can see by his screenshot above, he added the db to his project in the IDE. Unfortunately, that process is very fragile and has come back to bite him.

[/quote]
No, the question is about the variable/object “DB”. His screenshot shows a database named peopledb, so that does not answer the question.

The fact that the app compiles means that DB is declared somewhere and unlike what I said earlier, it is in scope since it compiles. The NilObjectException at runtime means that DB is Nil at that point in his code.

Can you try this:

  db.DatabaseFile = peopleDB
  If db.Connect  then
//do your stuff

let me see what that does.