|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: |
* GetTableStruces.GetSqlTableStructure * LMP 9/19/2008 - we will use this to grab a table structure and return it in an array * this works LPARAMETERS arRtnStructure, cSearchTableName AS STRING, cSearchDatabase AS STRING, iConnHandle AS INTEGER this parameter statment does not LPARAMETERS arRtnStructure, cSearchTableName AS STRING, cSearchDatabase AS STRING, iConnHandle AS INTEGER LOCAL iprevarea AS INTEGER, blnContinue AS Boolean, iResult AS INTEGER, blnCloseConnection AS Boolean LOCAL cExecString AS STRING, blnSuccess AS Boolean LOCAL blnCloseConnection as Boolean iprevarea = 0 blnContinue = .T. blnRtnValue = .F. blnSuccess = .F. cExecString = "" iResult = 0 * we are going to get a structure from a sql table * We MUST have the parameters of we can return nothing * 1st let's makes certain we have 2 parameters, that the are character type * that they are not empty IF !(VARTYPE(cSearchTableName) = "C" AND VARTYPE(cSearchDatabase) = "C") blnContinue = .F. ELSE IF (EMPTY(cSearchTableName) OR EMPTY(cSearchDatabase)) blnContinue = .F. ENDIF IF (VARTYPE(iConnHandle)<>"N") THEN iConnHandle = 0 ENDIF ENDIF IF blnContinue THEN * if we did not send a conection handle we will have to get one IF iConnHandle = 0 THEN blnCloseConnection = .T. iConnHandle= oSql.getsqlConnection(SBTCONNECTION) ENDIF * now we can continue to process the request for the structure cExecString = cExecString + "EXEC sbt.dbo.GetTableStructure ?cSearchTableName, ?cSearchDatabase" SQLPREPARE(iConnHandle, cExecString, "sqlTableStructure") iResult = SQLEXEC(iConnHandle) =AERROR(aErrList) IF iResult < 1 THEN * we have a problem emsgText = emsgText = "SqlExec Failed with " + cExecString =oErr.LogtheError(oErr.cProgramVersion, 0, LINENO(), LINENO(1), PROGRAM(),PROGRAM(0), SYS(16), emsgText , emsgText , emsgText , @aErrList, .T.,m.loginInit, lnConnhandle ) blnSuccess = .F. ELSE * we can now create our return array * noth of these lines will create the array properly AFIELDS(arRtnStructure,"sqlTableStructure") AFIELDS(this.afldlist,"sqlTableStructure") * close the cursor - we dont need it any more blnSuccess = .T. ENDIF ENDIF IF blnCloseConnection loSql.CloseSQLConnection(iConnHandle) ENDIF * this does not work RETURN this.afldList * this does work RETURN arRtnStructure |
Advertisement
| Hall of Fame |