viewpoint-particle

Author Topic: MySQL Properties...FYI  (Read 2774 times)

JTaylor

  • Pundit
  • *****
  • Posts: 1023
    • Data & Stuff Inc.
MySQL Properties...FYI
« on: March 14, 2014, 06:26:30 pm »
This may be something everyone knows but me (seems like a lot of things like that) but since I spent a bit of time figuring out the problem I thought I would pass it on...

Spent a lot of time trying to figure out why the following wasn't working since it had worked a short time before in the same script.

      ctxt = myREC2.Fields.Item(x).Properties("BASECOLUMNNAME").Value
      ttxt = myREC2.Fields.Item(x).Properties("BASETABLENAME").Value

Kept thinking I had inadvertently changed something and wasn't seeing it.   Finally asked the right question, "What was different than before?"  The answer was the Open Method parameters.  The first one allows for the interrogation of Properties.  The second does not...actually it doesn't error out on everything...sometimes just returns a blank value which was annoying and misleading.  Haven't sorted out what combinations work and which ones don't but thought I would pass on my hard-earned knowledge :)

  myREC2.Open (SQLText, myConn, adOpenForwardOnly, adLockBatchOptimistic, adCmdText)

  myREC2.Open (SQLText, myConn, adOpenStatic, adLockReadOnly, adCmdText)


Jim

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: MySQL Properties...FYI
« Reply #1 on: March 17, 2014, 10:58:50 am »
Here is a link to the ADO documentation that explains those Open Method parameters meaning: http://www.w3schools.com/ado/met_rs_open.asp
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

  • Pundit
  • *****
  • Posts: 1023
    • Data & Stuff Inc.
Re: MySQL Properties...FYI
« Reply #2 on: March 17, 2014, 12:23:54 pm »
Thanks...that is a useful link.  Don't see anywhere it mentions why certain ones block Properties but I may have missed it....mainly just wanted to let people know of my experience so as to help them keep head-shaped holes out of their walls like mine have.

Jim

stanl

  • Pundit
  • *****
  • Posts: 945
Re: MySQL Properties...FYI
« Reply #3 on: March 17, 2014, 12:41:51 pm »
I thought it was good you brought that up. It is akin to RecordCount returning 0 with the wrong cursortype. My rule is always to use keyset,optimistic unless I have over a million rows. BatchOpimistic only for persisted recordsets.

JTaylor

  • Pundit
  • *****
  • Posts: 1023
    • Data & Stuff Inc.
Re: MySQL Properties...FYI
« Reply #4 on: March 17, 2014, 01:11:15 pm »
That might solve a problem I encountered along that line some time back.  I had to do a MoveLast to get the record count.   May be related.   If I run across that code again I'll experiment.  Thanks.

Jim