Prev: SetSelectiveRelation
Next: VO 2.8 - Wait state
From: Jeff Williams on 1 Apr 2007 17:21 SELF:cSqlQry := String2Psz("SELECT d.sogg_id,s.sogg_nome FROM sedi AS d, sogg AS s WHERE d.sogg_id=s.sogg_id") the above is wrong try this SELF:cSqlQry := String2Psz("SELECT d.sogg_id,s.sogg_nome FROM sedi AS d JOIN sogg AS s ON d.sogg_id=s.sogg_id ") Regards Jeff
From: Biagio on 1 Apr 2007 19:07 Hi, with your code I have the same error Error message: -------------- Error Code: 19 [ VARIABLE NOT INITIALIZED ] Subsystem: BASE Function: IVARGET Argument: {(0x0000)0x00000000} CLASS CallStack: PMYSQLSERVER:GETTBLPKFIELDS (Line: 17) PMYSQLSERVER:ADDTABLE2ALLTABLE (Line: 5) PMYSQLSERVER:GETSERVERSTRUCTUR (Line: 46) PMYSQLSERVER:INIT (Line: 22) SEDI_WIN:INIT (Line: 33) I have wrote a new class for only reading data and now works fine. Thanks to all Biagio On 1 Apr, 23:21, Jeff Williams <jeff.williams_NO_S...(a)hardsoft.com.au> wrote: > SELF:cSqlQry := String2Psz("SELECT d.sogg_id,s.sogg_nome FROM sedi AS > d, sogg AS s WHERE d.sogg_id=s.sogg_id") > > the above is wrong > > try this > > SELF:cSqlQry := String2Psz("SELECT d.sogg_id,s.sogg_nome FROM sedi AS > d JOIN sogg AS s ON d.sogg_id=s.sogg_id ") > > Regards > Jeff
From: Klaus on 2 Apr 2007 04:42
Hi Biagio, this will not solve your problem, but you will get an exact errormessage and no runtimeerror. ;-) I can't reproduce the error with similar statements. In my latest lib I've changed the source <BOF> HIDDEN METHOD GetTblPkFields(oTbl AS pMySqlServerTable) AS VOID PASCAL CLASS pMySqlServer * Aufruf über self:AddTable2AllTable() * PK's zur Tabelle einsammeln für Updatestatment WHERE Bedingung LOCAL cTmp,cErr AS STRING LOCAL oRes AS pMySqlResult LOCAL stc_Res AS _tcxMySQL_RES LOCAL stc_Fld AS _tcxMYSQL_FIELD LOCAL i,nC AS DWORD LOCAL aPk AS ARRAY LOCAL aErw AS ARRAY IF !oTbl:cTable=="" cTmp:="SELECT * FROM "+oTbl:cDbAndTbl+" LIMIT 0" aErw:={,,} SELF:oConnection:Query(cTmp) IF !SELF:oConnection:errno=0 cErr:=SELF:oConnection:Error+CRLF+"QUERY:"+CRLF+cTmp +_Getcallstack() MessageBox(NULL,String2Psz(cErr),String2Psz("Fehlernr. "+NTrim(SELF:oConnection:errno)+" im Query."),MB_ICONERROR) ELSE oRes:=SELF:oConnection:store_result() nC:=oRes:num_fields nC-- stc_Res:=oRes:st_MySQL_RES FOR i:=0 UPTO nC stc_Fld:=mysql_fetch_field_direct(stc_Res,i) IF IS_PRI_KEY(stc_Fld.flags) cTmp:=Lower(STRING(stc_Fld.org_name)) IF AScan(oTbl:aStrucPK,{|aV|aV[1]=cTmp})=0 // PK ist noch nicht definiert, bzw. nicht im SELECT enthalten aPK:=ArrayCreate(5) SELF:MySqlStructur2VO(stc_Fld,aPk,aErw) AAdd(oTbl:aStrucPK,aPK) ENDIF ENDIF NEXT i oRes:Free() ENDIF ENDIF <EOF> Can you send me (klaus_dot_przybyla_at_freenet_dot_de) the tablestructure of the two tables, for more tests of the problem and the errormassage you got now. BTW the first parameter for pMySqlServer is declared as string, there's no need for String2Psz(). kind regards Klaus On 1 Apr., 12:59, "Biagio" <softw...(a)notario.it> wrote: > Hi, this is the code > > //------------------------------------------------------------------- > METHOD ReadRecord() CLASS Tabelle_BaseWin > > IF ! SELF:oDCbBrowser1:Server=NULL_OBJECT .and. > SELF:oDCbBrowser1:Server:Used > SELF:oDCbBrowser1:Use() > ENDIF > > SELF:cSqlQry := String2Psz("SELECT d.sogg_id,s.sogg_nome FROM sedi AS > d, sogg AS s WHERE d.sogg_id=s.sogg_id") > > SELF:oServer := pMySqlServer{SELF:cSqlQry,SysObject():SqlConn} > > SELF:oDCbBrowser1:Use(SELF:oServer) > > RETURN > //---------------------------------------------------------------- > > And this is the error > > ***********************ERROR******************************** > CA-Visual Objects (Version 2.6.0, Build 1151), Version 2.6 > 01/04/2007 12.48.55 > Application: c:\nb_app26\GestStudio.DBG > > Error message: > -------------- > Error Code: 19 [ VARIABLE NOT INITIALIZED ] > Subsystem: BASE > Function: IVARGET > Argument: {(0x0000)0x00000000} CLASS > CallStack: > PMYSQLSERVER:GETTBLPKFIELDS (Line: 17) > PMYSQLSERVER:ADDTABLE2ALLTABLE (Line: 5) > PMYSQLSERVER:GETSERVERSTRUCTUR (Line: 46) > PMYSQLSERVER:INIT (Line: 22) > TABELLE_BASEWIN:READRECORD (Line: 9) > > Error Object created: > -------------------- > SubSystem :BASE > SubCode :0 > GenCode :Variable not initialized > OsCode :0 > ArgType :NIL > FuncPtr :0x00000000 > ArgNum :0 > FuncSym :IVARGET > Severity :0 > CanDefault :.F. > CanRetry :.F. > CanSubstitute :.T. > Operation : > Description : > FileName : > Tries :0 > FileHandle :0 > SubCodeText : > Arg :{(0x0000)0x00000000} CLASS > ArgTypeReq :NIL > MaxSize :0 > SubstituteType :NIL > CallFuncSym : > -------------------- > > If I change the query in > > SELECT d.sogg_id,s.sogg_nome FROM sedi AS d JOIN sogg AS s ON > d.sogg_id=s.sogg_id > > I have the same error !!!! > > In a standard client application as HeidiSQL all works fine > > Thanks > > Biagio > > Klaus ha scritto: > > > > > Hi Biagio, > > > please, show the exact errormessage (linenumber), i'll take a look > > into the Method GetTablePkFields > > > regards > > Klaus > > > On 31 Mrz., 14:20, "Biagio" <softw...(a)notario.it> wrote: > > > Hi to all, > > > > pMySQLServer works fine, a powerfull library to migrate to MySql. > > > > If I won't link two tables with a natural join like: > > > > SELECT d.sogg_id,s.sogg_nome > > > FROM sedi AS d JOIN sogg AS s > > > WHERE d.sogg_id=s.sogg_id > > > > the pMySqlServer shows a error (....GetTblPkFields ) > > > > A idea to solve the problem? > > > > Thanks > > > > Biagio- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - |