DB Error

Questions regarding syntax

DB Error

Postby Henning » Wed Oct 13, 2010 11:09 pm

New error in accessing MySQL DB.

First the attached pic. then this.
---------------------------
KBasic
---------------------------
Unknow exception in KBasic runtime (kbrun).

---------------------------
OK
---------------------------

Code: Select all
    If sRecordsId Then
      If Records.First(sRecordsId) Then
        recCount = Records.Length(sRecordsId)
        frm_main.txtInfo.Text = recCount
        ReDim ArtRec(recCount + 1)
        rc = 1
        Do
          ArtRec(rc).arNr = Records.Value(sRecordsId, "artnr")
          ArtRec(rc).arArt = Records.Value(sRecordsId, "artikel")     '****** after this line it errors
          ArtRec(rc).arSize = Records.Value(sRecordsId, "size")
          ArtRec(rc).arType = Records.Value(sRecordsId, "type")
          ArtRec(rc).arID = Records.Value(sRecordsId, "artid")
          ArtRec(rc).arIndate = Records.Value(sRecordsId, "indate")
          ArtRec(rc).arInpris = CInt(Records.Value(sRecordsId, "inpris"))
          ArtRec(rc).arAntut = CInt(Records.Value(sRecordsId, "antut"))
          ArtRec(rc).arTotut = CInt(Records.Value(sRecordsId, "antuttot"))
          ArtRec(rc).arStat = CInt(Records.Value(sRecordsId, "artstat"))
          ArtRec(rc).arKvnr = CInt(Records.Value(sRecordsId, "artkv"))
          ArtRec(rc).arRedat = Records.Value(sRecordsId, "artret")
          ArtRec(rc).arKr = CInt(Records.Value(sRecordsId, "totkr"))
          ArtRec(rc).arKrtot = CInt(Records.Value(sRecordsId, "totkrtot"))
          ArtRec(rc).arAge = CInt(Records.Value(sRecordsId, "age"))
          ArtRec(rc).arPris = CInt(Records.Value(sRecordsId, "artpris"))
          rc = rc + 1
          Loop While Records.Next(sRecordsId)
        result = True
      Else


It has been working before, this is the first time I ran it after last update.

/Henning
KBasic_DBError.jpg
KBasic_DBError.jpg (32.76 KiB) Viewed 589 times
Henning
 
Posts: 262
Joined: Mon Feb 09, 2009 12:03 am
Location: Sweden

Re: DB Error

Postby dave_e » Thu Oct 14, 2010 1:18 pm

Hi Henning

Please forgive my curiosity, have you tried wrapping the size word in square brackets, e.g. [size]?

I had a problem in MS Access upgrading from one version to another where one of our fields was named size, it took forever to work out what was going on when stuff didn't work anymore. Replacing size with [size] where referenced did the trick. I just mention because you wrote how it errors after the line before the one that refers to size.

Dave
dave_e
 
Posts: 10
Joined: Tue May 11, 2010 7:34 pm

Re: DB Error

Postby Henning » Thu Oct 14, 2010 10:12 pm

Hi Dave,

In a SQL-string that or BackTick ` could make a difference, but the format here is the fieldname as string.

/Henning
Henning
 
Posts: 262
Joined: Mon Feb 09, 2009 12:03 am
Location: Sweden

Re: DB Error

Postby berndnoetscher » Fri Oct 15, 2010 10:20 am

Thanks for reporting.
Surprised about this error. Added it to the todo list. Though it will take some time as I am busy with Q7Basic.
berndnoetscher
Site Admin
 
Posts: 1059
Joined: Tue Sep 25, 2007 9:37 am


Return to Coding Questions

cron