messages
listlengths 1
1
| topic
stringlengths 2
60
|
---|---|
[
{
"date": "2006-04-03",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Julio como el link de las classes esta roto, no puedo hacer pruebas directas lo que te mande fue con la conversion de la tabla, por lo que comento que la tabla esta bien.\n\n\npuedes subirlo a: <!-- m --><a class=\"postlink\" href=\"ftp://proyectos.ita.mx\">ftp://proyectos.ita.mx</a><!-- m -->\n usuario:fer\n pasword:fer\n\no enviamela por correo. \n\nsaludos\nfernando snadoval ruiz",
"time": "20:23",
"topic": "ADO no me funciona en una tabla en especifico",
"username": "fsandoval"
}
] |
ADO no me funciona en una tabla en especifico
|
[
{
"date": "2006-04-03",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Por favor, los ficheros que intercambieis alojadlos en <!-- w --><a class=\"postlink\" href=\"http://www.hyperupload.com\">www.hyperupload.com</a><!-- w --> y publicar aqui el enlace de descarga para que asi otros usuarios puedan acceder a ellos. gracias.",
"time": "20:47",
"topic": "ADO no me funciona en una tabla en especifico",
"username": "Antonio Linares"
}
] |
ADO no me funciona en una tabla en especifico
|
[
{
"date": "2006-04-07",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Bueno, este es el final de este capitulo de la trilogía \"ADO y yo\" !\n\nEl asunto esta solucionado. Son tantas las consideraciones y aprendizajes con esto que me paso, que creo que estaré escribiendo algo mas amplio en mi recién abierto blog. Intentaré resumir aquí algunos puntos importantes para los \"foronautas\":\n\n- Despues de buscar mucho entre las opciones para hacer el OPEN en el RS y en la conexion, confirmo que las mejores son las que aparecen en el ejemplo de JLC. \n\n- El asunto estaba en la forma de \"grabar\" el registro en el recordset, que para los fines de la clase ADORS se trata de errores cometidos por mi en el método SAVE(). El grabar en el recordset es uno de los aspectos mas delicados que he encontrado en ADO.\n\n- El mensaje que aparecia era consecuencia de que el RS se \"cerraba\" cuando se hacia una sustitucion que no le gustaba. Mucha luz me trajo a esto el nuevo amigo Fernando Sandoval, cuando me invitó a verificar el tipo de datos que quiero \"grabar\" y el tipo de datos de la columna que quiero que los acepte.\n\n- El problema se concentraba en los campos tipo fecha. Intentaba escribir una fecha en un campo que el ADO lo interpretó como de tipo \"indefinido\". Lo descubrí haciendo VALTYPE( ::oRs:Fields(\"Fecha\"):value ) sobre una fecha en blanco, pues me devolvía \"U\", mientras que cuando el registro tenía una fecha correcta, me devolvía \"D\". Fue entonces que, por sugerencia de FS evité realizar esta sustitución. Aun me falta probar un poco mas con este caso, pero ya está controlado.\n\n- La otra cosa, fue la pregunta clave: \"¿UPDATE o no UPDATE?\".... pues cuando el registro no ha sido cambiado, no debe hacerse. JLC me sugirió en otra parte del foro una manera de realizarlo, pero no me funcionó, así que lo implementé localmente dentro del método SAVE(), y funciona perfectamente.\n\nEstaré probando otras cosas durante la Semana Santa:\n\n- manejo de campos MEMO (BLOB?, TEXT?)\n- Generacion de reportes\n- manejo de ADO por internet, etc.\n\nAsi que por ahora, este capítulo lo considero cerrado. Estaré también publicando las clases modificadas de JLC en mi blog ([url:27i3ejgs]http://mangucybernetico.blogspot.com/[/url:27i3ejgs]) para los que estén interesados, mas un ejemplo realizado por mi para demostrarme a mi mismo la potencia maravillosa del uso de ADO en todo esto.\n\nGracias a todos, en especial a JLC y FS por su paciencia, y sera hasta otro capítulo.\n\n.... Y LA SAGA CONTINUA !!!!",
"time": "12:02",
"topic": "ADO no me funciona en una tabla en especifico",
"username": "jllinas"
}
] |
ADO no me funciona en una tabla en especifico
|
[
{
"date": "2006-01-26",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Ola pessoal, estou trabalhando com o ADO para o ACCESS porem alguns comandos conforme relação abaixo não funciona! sabem porque?\n\n****************************************************\n#Include \"Fivewin.ch\"\nFunction Main()\nLOCAL oDados, txSql\nPRIVATE oCn := CREATEOBJECT( \"ADODB.Connection\" )\n\noCn:Open( \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=venda.mdb\" )\ntxSql := \"SELECT * FROM imovweb; \"\noDados := oCn:Execute( txSql)\n\noDados:MoveNext() -- Funciona\noDados:MoveFirst() -- NÃO Funciona\noDados:MoveLast() -- NÃO Funciona\noDados:RecordCount() -- NÃO Funciona\n****************************************************",
"time": "14:39",
"topic": "ADO não funciona o RecordCount()?",
"username": "ronaldo"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-26",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Ola pessoal, estou trabalhando com o ADO para o ACCESS porem alguns comandos conforme relação abaixo não funciona! sabem porque?\n\n****************************************************\n#Include \"Fivewin.ch\"\nFunction Main()\nLOCAL oDados, txSql\nPRIVATE oCn := CREATEOBJECT( \"ADODB.Connection\" )\n\noCn:Open( \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=venda.mdb\" )\ntxSql := \"SELECT * FROM imovweb; \"\noDados := oCn:Execute( txSql)\n\noDados:MoveNext() -- Funciona\noDados:MoveFirst() -- NÃO Funciona\noDados:MoveLast() -- NÃO Funciona\noDados:RecordCount() -- NÃO Funciona\n****************************************************",
"time": "14:43",
"topic": "ADO não funciona o RecordCount()?",
"username": "ronaldo"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-26",
"forum": "FiveWin for Harbour/xHarbour",
"text": "From the MSDN:\n\n\"The returned Recordset object is always a read-only, forward-only cursor.\"\n\nUse recordsets instead of connections:\n\n[code:2nkza2xb]#define adOpenForwardOnly 0\n#define adOpenKeyset 1\n#define adOpenDynamic 2\n#define adOpenStatic 3\n\n#define adLockReadOnly 1\n#define adLockPessimistic 2\n#define adLockOptimistic 3\n#define adLockBatchOptimistic 4\n\n\nFUNCTION MAIN()\n\n LOCAL oRs := CREATEOBJECT( \"ADODB.Recordset\" )\n\n oRs:Open( \"SELECT * FROM Clienti\", \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb\", adOpenKeyset, adLockReadOnly )\n\n oRs:MoveLast()\n\n WHILE !oRs:EOF\n ? oRs:Fields( \"Cliente\" ):Value\n oRs:MoveNext()\n ENDDO\n\n oRs:Close()\n\n INKEY( 0 )\n\n RETURN NIL[/code:2nkza2xb]\n\nEMG",
"time": "15:13",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-26",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Perfect!\n\nMuito obrigado,\nRonaldo Minacapelli",
"time": "16:38",
"topic": "ADO não funciona o RecordCount()?",
"username": "ronaldo"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-31",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Ronaldo,\n\n¿Donde tienes el cursor? ¿¿Que valor tiene CursorLocation del objeto Connection??\n\nSaludos,\nJosé Luis Capel",
"time": "17:52",
"topic": "ADO não funciona o RecordCount()?",
"username": "jlcapel"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-31",
"forum": "FiveWin para Harbour/xHarbour",
"text": "No uses objetos CONNECTION para ejecutar el query, los objetos CONNECTION regresan un cursor forward que no puede recuperar los valores que necesitas.\n\nCrea un objeto Connection, luego un objeto Command y eso te devolvera el RecordSet que necesitas.",
"time": "18:30",
"topic": "ADO não funciona o RecordCount()?",
"username": "R.F."
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-01-31",
"forum": "FiveWin para Harbour/xHarbour",
"text": "René,\n\n[quote:37sla978]No uses objetos CONNECTION para ejecutar el query, los objetos CONNECTION regresan un cursor forward que no puede recuperar los valores que necesitas.[/quote:37sla978]\n\nNo es exactamente como tu dices. El método execute del objeto Connection devuelve siempre un recordset del tipo y localización que has indicado en la creación del objeto Connection (y si no se indican, se utilizan los valores por defecto).\n\n[quote:37sla978]Crea un objeto Connection, luego un objeto Command y eso te devolvera el RecordSet que necesitas.[/quote:37sla978]\n\nTampoco es exactamente así. Si vas a trabajar con resultados de datos (filas y columnas) es preferible siempre utilizar el objeto Recordset y reservar el objeto Command para llamadas a procedimientos almacenados y otras funciones de servidor.\n\nSaludos,\nJosé Luis Capel",
"time": "19:14",
"topic": "ADO não funciona o RecordCount()?",
"username": "jlcapel"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-01",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Ronaldo,\n\nPrueba este código a ver si te ayuda a clarificar por que no te funcionan los métodos que indicas:\n\n[code:1bllbe90]#Include \"Fivewin.ch\"\n\n#define adBookmark 0x2000 \n#define adMovePrevious 0x200 \n\n\nFunction Main()\nLOCAL oDados, txSql\nPRIVATE oCn := CREATEOBJECT( \"ADODB.Connection\" )\n\noCn:Open( \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=venda.mdb\" )\ntxSql := \"SELECT * FROM imovweb; \"\noDados := oCn:Execute( txSql)\n\nMsgInfo( IIF(oDados:Supports(adBookmark),\"Soporta RecordCount\",\"No soporta RecordCount\"))\n\nMsgInfo( IIF(oDados:Supports(adMovePrevious),\"Soporta MoveFirst, MovePrevious, etc\",\"No soporta MoveFirst, MovePrevious, etc\"))\n\n....\n[/code:1bllbe90]\n\nNo lo he probado... Espero que esto te ayude.\nSaludos,\nJosé Luis Capel",
"time": "13:19",
"topic": "ADO não funciona o RecordCount()?",
"username": "jlcapel"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hi enrico..\n\nDo you Know , Where Find Mtehods and DATA from this Class..\n\n\nCREATEOBJECT( \"ADODB.Recordset\" )\n\n\nThanks",
"time": "02:35",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "On the MSDN.\n\nEMG",
"time": "09:13",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Thanks Enrico...\n\n I´m Learn About ADO, But You Can Response Only Two Asks?\n\n\n First ..\n\n Using ADODB My Systems Are Compatible With win98 , winxp , win2003 ?\n\n Second..\n\n Using ADODB My Systems Required DATABASE registre in ODBC ?",
"time": "15:02",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "1) WinXP and Win2003: yes. Win98: you will need to install Office or MSDE.\n\n2) No.\n\nEMG",
"time": "16:48",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-02-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Thanks Very Much Enrico.\n\n\n \nMauricio",
"time": "17:00",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-01",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"EnricoMaria\":1u5q0l6s]1) WinXP and Win2003: yes. Win98: you will need to install Office or MSDE.[/quote:1u5q0l6s]\n\nSorry, MDAC not MSDE.\n\nEMG",
"time": "17:24",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Thanks Enrico AGAIN...\n\n i´m modify TCBROWSE to ADO\n\n How Get Field Names of Database Using ADO ?\n\n\n\n\nthanks Mauricio",
"time": "00:12",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[code:hyoifeh7]#define adOpenForwardOnly 0\n#define adOpenKeyset 1\n#define adOpenDynamic 2\n#define adOpenStatic 3\n\n#define adLockReadOnly 1\n#define adLockPessimistic 2\n#define adLockOptimistic 3\n#define adLockBatchOptimistic 4\n\n\nFUNCTION MAIN()\n\n LOCAL oCat\n\n LOCAL i, j\n\n oCat = CREATEOBJECT( \"ADOX.Catalog\" )\n\n oCat:ActiveConnection = \"Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\\Emag;Initial Catalog=Quadro\"\n\n FOR i = 0 TO oCat:Tables:Count() - 1\n ? oCat:Tables( i ):Name\n ?\n\n FOR j = 0 TO oCat:Tables( i ):Columns:Count() - 1\n ? SPACE( 4 ) + oCat:Tables( i ):Columns( j ):Name\n NEXT\n\n ?\n NEXT\n\n RETURN NIL[/code:hyoifeh7]\n\nEMG",
"time": "08:53",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Enrico ,\n\nThe Object Change ADO for ADOX because You are Using Extend ADO methods, Thats Right?\n\n\nThe Extende ADO methods are 100% compatible ?\n\n\n\n\nthanks , AGAIN\n\nmauricio\n(brazil)",
"time": "10:27",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"mauricioajordao\":10ldrvt6]Enrico ,\n\nThe Object Change ADO for ADOX because You are Using Extend ADO methods, Thats Right?\n\n\nThe Extende ADO methods are 100% compatible ?[/quote:10ldrvt6]\n\nYes and yes.\n\nEMG",
"time": "11:14",
"topic": "ADO não funciona o RecordCount()?",
"username": "Enrico Maria Giordano"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2006-03-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "THANKS AGAIN\n\nMAURICIO",
"time": "11:31",
"topic": "ADO não funciona o RecordCount()?",
"username": "mauricioajordao"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2010-03-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Hola : proba asi si usas Ado \n\n oData1:RecordCount() Asi no funciona \n\n \n\n If oData1:RecordCount > 0 \n ? \"Hay \"\n EndIf",
"time": "18:47",
"topic": "ADO não funciona o RecordCount()?",
"username": "juan carlos bellucci"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2010-03-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "A mi me funciona Asi. COn Mysql\n \n\n if oDatos:RecordCount() =0 //ADORecCount()\n MsgInfo(\"No Hay Datos \",\"Informacion\") Return (.t.)\n endif\n nLinea := 1 ; nHasta := oDatos:RecordCount()\n oDatos:MoveFirst()",
"time": "23:20",
"topic": "ADO não funciona o RecordCount()?",
"username": "ruben Dario"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2010-03-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Por qué no usas un recordset. Prueba así:\n\n\n****************************************************\n#Include \"Fivewin.ch\"\nFunction Main()\nLOCAL txSql\nPRIVATE oCn,oRs,oError\n\n//Crea el objeto conexión\nTRY\n\toCn := TOleAuto():new(\"adodb.connection\")\nCATCH oError\n\tMsgStop( \"No se pudo crear el objeto conexión !\")\n\tRETURN(.F.)\nEND\n\n//Crea el objeto recordset que manejará la tabla\nTRY\n\toRs := TOleAuto():New(\"adodb.recordset\") \nCATCH oError\n\tMsgStop( \"No se pudo crear el recordset)\n\tRETURN .f.\nEND\n\n//Abrimos la conexión \nTRY\n\toCn:Open( \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=venda.mdb\" )\nCATCH oError\n\tMsgStop( \"No se pudo abrir la conexión !\")\n\treturn .f.\nEND\n\n\n//Configuramos el recordset que manejara la tabla \noRs:CursorLocation := adUseClient\noRs:LockType := adLockOptimistic\noRs:CursorType := adOpenKeyset//adOpenDynamic\noRs:Source := \"SELECT * FROM imovweb; \"\noRs:ActiveConnection(oCn)\n//Ahora si cargamos los datos en el recordset\nTRY\n\toRs:Open()\nCATCH oError\n\tMsgStop( \"No se pudo cargar los datos de la Tabla imovweb\")\n\tRETURN .f.\nEND\n\n//asegurarse que la tabla no esté vacía para usar\n//los métodos que pones de ejemplo\nif ! oRs:BOF() .AND. ! oRs:EOF()\n\t\toRs:MoveNext() //-- Funciona\n\t\toRs:MoveFirst() //-- NÃO Funciona\n\t\toRs:MoveLast() //-- NÃO Funciona\n\t\toRs:RecordCount()// -- NÃO Funciona\nendif\n\nors:Close()\noCn:Close()\n****************************************************\n\nSaludos\n\nMarcelo Jingo",
"time": "23:53",
"topic": "ADO não funciona o RecordCount()?",
"username": "sjingo"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2010-03-18",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Então, creio que essas opções não funcionem, pois voc~e deve verificar a forma de abertura do RecordSet.\n\nRonaldo Minacapelli",
"time": "21:40",
"topic": "ADO não funciona o RecordCount()?",
"username": "ronaldo"
}
] |
ADO não funciona o RecordCount()?
|
[
{
"date": "2019-09-16",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Hola,\n\n¿Sabéis donde puedo encontrar la documentación de sus parámetros?\n\nMuchas gracias.",
"time": "19:04",
"topic": "ADO oCn:Backup()",
"username": "MOISES"
}
] |
ADO oCn:Backup()
|
[
{
"date": "2019-09-16",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Moises:\n\nDale una revisión a MySqlDump.exe y MySQL.Exe, para hacer\nel respaldo/recuperación de acuerdo a tus necesidades.\n\nSaludos",
"time": "19:34",
"topic": "ADO oCn:Backup()",
"username": "Armando"
}
] |
ADO oCn:Backup()
|
[
{
"date": "2019-09-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Muchas gracias por contestar. Busco una aproximación vía ADO para MySQL/MSSQL/María DB, neutral por tanto desde el punto de vista de la base de datos.\n\nCreo que existe este método, pero no he encontrado sus parámetros.\n\nUn saludo",
"time": "12:52",
"topic": "ADO oCn:Backup()",
"username": "MOISES"
}
] |
ADO oCn:Backup()
|
[
{
"date": "2019-09-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Moises:\n\nMira este link\n\n<!-- m --><a class=\"postlink\" href=\"https://www.linode.com/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/\">https://www.linode.com/docs/databases/m ... r-mariadb/</a><!-- m -->\n\nSaludos",
"time": "16:15",
"topic": "ADO oCn:Backup()",
"username": "Armando"
}
] |
ADO oCn:Backup()
|
[
{
"date": "2019-09-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Muchas gracias, pero no es lo que busco, porque el backup se tiene que hacer desde el propio programa y usando los métodos de ADO, para que funcione también en MSSQL, SQLite. etc.",
"time": "16:49",
"topic": "ADO oCn:Backup()",
"username": "MOISES"
}
] |
ADO oCn:Backup()
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hello,\n\nI'm using ADO and at the begin op my program I open a connection to the SQL-server.\nThis program is running for a long time, and sometimes I get a ''MySQL server has gone away'-error.\nThis is always when executing a command like 'INSERT INTO', not with recordsets. With recordsets, I allways create a new recordset when reading data.\n\nThat was the same problem that I had after resuming al laptop.\n[url:21sw9dws]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28763&p=161537&hilit=connection+laptop#p161537[/url:21sw9dws]\n\nNow I was wondering if it would be beter to not open a connection at the beginning of the program and close in at the end,\nbut open a connecion only if i want to execute a SQL-command, like 'INSERT INTO',.. and than close it again.\nFor reading data I allways use a recordset, and than I also open it before reading.\n\nWill the program become slower by allways opening and closing a connection? Are there other disadvantages doing this?\nAre there other people do this also?",
"time": "10:45",
"topic": "ADO open/close Connection Question",
"username": "Marc Vanzegbroeck"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nI always open a recodset only when needed. Programs don't slow down. If you have to write a bunch of record then take care to open and close the recordset only once.\n\nEMG",
"time": "12:22",
"topic": "ADO open/close Connection Question",
"username": "Enrico Maria Giordano"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Enrico,\n\nI always open and close also when using a recordset, but if I want to inset records, or delete records, I don't use recordsets.\nI use the [code=fw:2ojj9uo6]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">oSQL:=CreateObject<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ADODB.Connection\"</span><span style=\"color: #000000;\">)</span></div>[/code:2ojj9uo6] and then [code=fw:2ojj9uo6]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span></div>[/code:2ojj9uo6] command.\nDo you use also recordsets for adding and deleting records?",
"time": "12:31",
"topic": "ADO open/close Connection Question",
"username": "Marc Vanzegbroeck"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nIf you don't use recordsets you still need to open and close connections.\n\nEMG",
"time": "13:25",
"topic": "ADO open/close Connection Question",
"username": "Enrico Maria Giordano"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"Enrico Maria Giordano\":1see933g]Marc,\n\nIf you don't use recordsets you still need to open and close connections.\n\nEMG[/quote:1see933g]\n\nEnrico,\n\nThat was my question. Now I'm opening the connection at the beginning of the program, and close it at exit.\nThe problem is that sometimes when the program is a long time active, that the coenction is gone, and I was modering if it will be better instead of opening it at the beginning of the program, that I open the connectecion just before executing a SQL-command, and direct close it again.",
"time": "14:16",
"topic": "ADO open/close Connection Question",
"username": "Marc Vanzegbroeck"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nyour best option is to open che connection just before the call to one or more Execute() methods and to close it at the end.\n\nEMG",
"time": "15:07",
"topic": "ADO open/close Connection Question",
"username": "Enrico Maria Giordano"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"Enrico Maria Giordano\":28hny0hm]Marc,\n\nyour best option is to open che connection just before the call to one or more Execute() methods and to close it at the end.\n\nEMG[/quote:28hny0hm]\n\nThanks Enrico,\n\nJust one more question.\nIs is the best that solution that 1 onlo use \n[quote:28hny0hm]oSQL:=CreateObject(\"ADODB.Connection\")[/quote:28hny0hm]\nat the beginning op the program, and then use\n[code=fw:28hny0hm]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />....<br />oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />....<br />oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br />oSQL:=<span style=\"color: #00C800;\">nil</span><br /> </div>[/code:28hny0hm]\n\nor always do[code=fw:28hny0hm]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">oSQL:=CreateObject<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ADODB.Connection\"</span><span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oSQL:=<span style=\"color: #00C800;\">nil</span><br />...<br />oSQL:=CreateObject<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ADODB.Connection\"</span><span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oSQL:=<span style=\"color: #00C800;\">nil</span><br />...<br />oSQL:=CreateObject<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ADODB.Connection\"</span><span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oQry=oSQL:<span style=\"color: #000000;\">execute</span><span style=\"color: #000000;\">(</span>.....<span style=\"color: #000000;\">)</span><br />oSQL:<span style=\"color: #000000;\">close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oSQL:=<span style=\"color: #00C800;\">nil</span><br /> </div>[/code:28hny0hm]",
"time": "16:45",
"topic": "ADO open/close Connection Question",
"username": "Marc Vanzegbroeck"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2014-12-07",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nyou can safely use the first option (one only CreateObject()).\n\nEMG",
"time": "17:10",
"topic": "ADO open/close Connection Question",
"username": "Enrico Maria Giordano"
}
] |
ADO open/close Connection Question
|
[
{
"date": "2006-08-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hi guys\n\nUsually in PHP when I need to insert a record in an SQL table I check first the primary key value to avoid to get an error for duplicate key entry.\nI'm uploading a .dbf file to a SQL table. The .dbf has values there exist in the SQL table. I'm using the AddNew() and Update() Method but on having tried to insert a duplicate value into the SQL table I get an error of course.\nHow can I check the value before the insert sentence?\nThis is my code\n[code:27uowtuz]\ndo while !cSource->( Eof() )\n// cSQLCommand := \"SELECT * FROM FPPtoNom WHERE PtoNomCod=\" + bTrans( AllTrim( cSource->PtoNomCod ) )\n// if oCursor:Open( cSQLCommand, oSQL:oConexion:oConnection ) .and. oCursor:oRs:RecordCount = 0\n\toCursor:oRs:AddNew()\n\toCursor:oRs:fields(\"PtoNomCod\"):value := AllTrim( cSource->PtoNomCod )\n\toCursor:oRs:fields(\"PtoNomAbr\"):value := AllTrim( cSource->PtoNomAbr )\n\toCursor:oRs:fields(\"PtoNomDes\"):value := AllTrim( cSource->PtoNomDes )\n\toCursor:oRs:fields(\"PtoNomtip\"):value := AllTrim( cSource->PtoNomTip )\n\toCursor:oRs:Update()\n// endif\n\tcSource->( dBSkip() )\nenddo[/code:27uowtuz]\n\n\nThanks",
"time": "22:12",
"topic": "ADO question",
"username": "wpacheco"
}
] |
ADO question
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hello,\n\nI am using an Access 2003 database via ADO in a single PC.\n\nSometimes, when I add the records the recordset is not refreshed, despite the call of oRs:Requery(), even twice. I have to wait 3-4 seconds and after that time it is refreshed.\n\nI only experience such behaviour with Access, it is beeing a nighmare.\n\nThis is the connection string:\n\n cStr := 'Provider='+\"Microsoft.Jet.OLEDB.4.0\"+';Data Source='+cBD\n\n\n\nAnd this is how I open the recordset and the database:\n\n LOCAL oError\n\n DEFAULT cSQL := \"SELECT * From TablaInexistente\"\n\n\n\n // open a recordset on demand with sql statement and connection string\n oRsUser := TOleAuto():New( \"ADODB.Recordset\" )\n oRsUser:CursorType := 1 // opendkeyset\n oRsUser:CursorLocation := 3 // local cache\n oRsUser:LockType := 3 // lockoportunistic\n\n\n TRY\n oRsUser:Open( cSQL, cStr )\n oCn := oRsUser:ActiveConnection\n oRdbms := FW_RDBMSName( oCn )\n\n CATCH oError\n ado_ErrorNoRecordSet(oError) // Mensaje de Error\n oRsUser := nil\n END\n\n\n\nMaybe opportunistick lock?. But it is not used on network.\n\nAny clue please?.\n\nThank you.",
"time": "14:03",
"topic": "ADO question: Access is not refresing properly",
"username": "lucasdebeltran"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Lucas,\n\nI am using ADO + Access on a development and I don't call oRs:Requery() when adding a record and here it works fine <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\nI use:\n\noRS:MoveLast()\noRs:AddNew()\nfill the right values\noRS:Update()",
"time": "14:05",
"topic": "ADO question: Access is not refresing properly",
"username": "Antonio Linares"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\n[quote=\"Antonio Linares\":lw2j3qoo]oRS:MoveLast()\noRs:AddNew()\nfill the right values\noRS:Update()[/quote:lw2j3qoo]\n\nYou can safely remove oRS:MoveLast(). <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\nEMG",
"time": "14:17",
"topic": "ADO question: Access is not refresing properly",
"username": "Enrico Maria Giordano"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hello,\n\nThis is a complete test:\n<!-- m --><a class=\"postlink\" href=\"http://demo.ovh.es/en/9beda86cc9165fb7bae4af1cd65c05f9/\">http://demo.ovh.es/en/9beda86cc9165fb7bae4af1cd65c05f9/</a><!-- m -->\n\nJust click on Añadir, and you will see that oRs is not updated:\n\n[img:1q01ldrs]http://i44.tinypic.com/2je4j14.png[/img:1q01ldrs]\n\nThank you.\n\n\n.prg:\n[code=fw:1q01ldrs]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #B900B9;\">//</span><br /><span style=\"color: #B900B9;\">// Test oRs Not refreshing in Access</span><br /><span style=\"color: #B900B9;\">//</span><br /><span style=\"color: #B900B9;\">//---------------------</span><br /><br /><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</span><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"xbrowse.ch\"</span><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"report.ch\"</span><br /><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"dbstruct.ch\"</span><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"adodef.ch\"</span><br /><br /><br /><span style=\"color: #00C800;\">STATIC</span> oCn, cStr<br /><span style=\"color: #00C800;\">STATIC</span> oRsUser, oRdbms <span style=\"color: #B900B9;\">// RecordSet</span><br /><br /><br />REQUEST HB_Lang_ES<br />REQUEST HB_CODEPAGE_ESWIN<br /><br /><span style=\"color: #B900B9;\">//--------------------------------------------------------------------------//</span><br /><br /><br /><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><span style=\"color: #00C800;\">FUNCTION</span> MAIN<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><br /> <span style=\"color: #B900B9;\">// Idioma español para Harbour--------------------------------------------</span><br /> HB_LangSelect<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ESWIN\"</span><span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Para mensajes, fechas, etc..</span><br /> HB_CDPSELECT<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ESWIN\"</span><span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Para ordenación, requiere CodePage.lib</span><br /><br /><br /><br /><br /><br /><br /> <span style=\"color: #B900B9;\">// Sets generales---------------------------------------------------------</span><br /> SetGetColorFocus<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Cambiar el foco del GET</span><br /> SET EPOCH <span style=\"color: #0000ff;\">TO</span> <span style=\"color: #000000;\">1990</span> <span style=\"color: #B900B9;\">// Admite los años desde el 1990 en adelante</span><br /> SET CENTURY <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #B900B9;\">// 4 dígitos año</span><br /> SET DATE ITALIAN <span style=\"color: #B900B9;\">// formato dd-mm-yyyy</span><br /> SET DELETED <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #B900B9;\">// Impedir ver registros marcados borrar</span><br /> SetCancel<span style=\"color: #000000;\">(</span> .F. <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Inutiliza ALT + C para abortar programa</span><br /> SetDialogEsc<span style=\"color: #000000;\">(</span> .F. <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Impide salir Diálogos con Escape</span><br /> SET<span style=\"color: #000000;\">(</span> _SET_INSERT, .T. <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Activa modo Insert</span><br /><br /> XBrNumFormat<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"E\"</span>, .t. <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Picture xBrowse formato Europeo decimales</span><br /> SetBalloon<span style=\"color: #000000;\">(</span> .T. <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Balloon shape required for tooltips</span><br /><br /><br /><br /> ado_string<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /> VerApuntes<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /><br />QUIT<br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><br /><br /><br /><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><span style=\"color: #B900B9;\">// Función ....: VerApuntes</span><br /><span style=\"color: #B900B9;\">// Descripción.: Browse en pantalla de los apuntes</span><br /><span style=\"color: #B900B9;\">// Desde ?l se llaman las opciones de edici¢n, etc</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><span style=\"color: #00C800;\">FUNCTION</span> VerApuntes<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">LOCAL</span> oDlg, oBrowse<br /> <span style=\"color: #00C800;\">LOCAL</span> oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6<br /><br /> <span style=\"color: #00C800;\">LOCAL</span> oRs<br /> <span style=\"color: #00C800;\">LOCAL</span> nPos := <span style=\"color: #000000;\">0</span><br /><br /><br /><br /> <span style=\"color: #B900B9;\">//</span><br /> <span style=\"color: #B900B9;\">// RecordSet</span><br /> <span style=\"color: #B900B9;\">//-----------</span><br /> oRs := ado_AbreRecordSet<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"select * from APUNTES order by FECHA ASC\"</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">IF</span> oRs = <span style=\"color: #00C800;\">nil</span><br /> <span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /> <span style=\"color: #00C800;\">ENDIF</span><br /><br /><br /><br /><br /><br /> <span style=\"color: #B900B9;\">//</span><br /> <span style=\"color: #B900B9;\">// Caja de Diálogo -----------------------------------------------------</span><br /> <span style=\"color: #0000ff;\">DEFINE</span> <span style=\"color: #0000ff;\">DIALOG</span> oDlg <span style=\"color: #0000ff;\">RESOURCE</span> <span style=\"color: #ff0000;\">\"APUNTES\"</span> ;<br /> <span style=\"color: #0000ff;\">TITLE</span> <span style=\"color: #ff0000;\">\"Mantenimiento de los APUNTES contables\"</span><br /><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">XBROWSE</span> oBrowse <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">101</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> DATASOURCE oRs ;<br /> COLUMNS <span style=\"color: #ff0000;\">\"FECHA\"</span>, <span style=\"color: #ff0000;\">\"CUENTA\"</span>, <span style=\"color: #ff0000;\">\"APUNTE\"</span>, <span style=\"color: #ff0000;\">\"NINGRESO\"</span>, <span style=\"color: #ff0000;\">\"NGASTO\"</span>, <span style=\"color: #ff0000;\">\"NOTAS\"</span> ;<br /> HEADERS <span style=\"color: #ff0000;\">\"Fecha\"</span>, <span style=\"color: #ff0000;\">\"Cuenta\"</span>, <span style=\"color: #ff0000;\">\"Apunte\"</span>, <span style=\"color: #ff0000;\">\"Ingreso\"</span>, <span style=\"color: #ff0000;\">\"Gasto\"</span>, <span style=\"color: #ff0000;\">\"Observaciones\"</span> ;<br /> <span style=\"color: #0000ff;\">AUTOCOLS</span> AUTOSORT CELL LINES<br /><br /><br /><br /> <span style=\"color: #B900B9;\">// Estilo-----------</span><br /> oBrowse:<span style=\"color: #000000;\">nMarqueeStyle</span> := <span style=\"color: #000000;\">5</span> <span style=\"color: #B900B9;\">//9 // 5 por defecto MARQSTYLE_IDESOFT</span><br /> oBrowse:<span style=\"color: #000000;\">nHeaderLines</span> := <span style=\"color: #000000;\">1.5</span><br /> oBrowse:<span style=\"color: #000000;\">nStretchCol</span> := STRETCHCOL_LAST<br /> oBrowse:<span style=\"color: #000000;\">lAllowColHiding</span> := .F. <span style=\"color: #B900B9;\">// Impedir tocar columnas</span><br /><br /><br /> oBrowse:<span style=\"color: #000000;\">blDblClick</span> := <span style=\"color: #000000;\">{</span> || <span style=\"color: #000000;\">(</span> oBtn3:<span style=\"color: #0000ff;\">Click</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span><br /> oBrowse:<span style=\"color: #000000;\">bKeyDown</span> := <span style=\"color: #000000;\">{</span> | nKey, nFlags | <span style=\"color: #00C800;\">IF</span> <span style=\"color: #000000;\">(</span>nKey==VK_RETURN, oDlg:<span style=\"color: #000000;\">End</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, <span style=\"color: #000000;\">)</span>,;<br /> <span style=\"color: #00C800;\">IF</span> <span style=\"color: #000000;\">(</span>nKey==VK_ESCAPE, oDlg:<span style=\"color: #000000;\">End</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span><br /><br /><br /><br /><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn1 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">711</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> AltasApuntes<span style=\"color: #000000;\">(</span> .T. <span style=\"color: #000000;\">)</span>, ;<br /> oRs:<span style=\"color: #000000;\">Requery</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, <span style=\"color: #0000ff;\">xbrowse</span><span style=\"color: #000000;\">(</span>oRs<span style=\"color: #000000;\">)</span>, oBrowse:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, oBrowse:<span style=\"color: #000000;\">SetFocus</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn2 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">712</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> ado_Borrar<span style=\"color: #000000;\">(</span> oRs <span style=\"color: #000000;\">)</span>, ;<br /> oBrowse:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn3 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">713</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> nPos := oRs:<span style=\"color: #000000;\">AbsolutePosition</span>, AltasApuntes<span style=\"color: #000000;\">(</span> .F., oRs:<span style=\"color: #000000;\">AbsolutePosition</span> <span style=\"color: #000000;\">)</span>, ;<br /> oRs:<span style=\"color: #000000;\">Requery</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, oRs:<span style=\"color: #000000;\">AbsolutePosition</span> := nPos, oBrowse:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn4 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">714</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> oRs:<span style=\"color: #000000;\">Requery</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>, oBrowse:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn5 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">715</span> <span style=\"color: #0000ff;\">OF</span> oDlg ;<br /> <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> oBrowse:<span style=\"color: #000000;\">Report</span><span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"Apuntes´s list\"</span><span style=\"color: #000000;\">)</span>, oBrowse:<span style=\"color: #0000ff;\">Refresh</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #0000ff;\">REDEFINE</span> <span style=\"color: #0000ff;\">BUTTON</span> oBtn6 <span style=\"color: #0000ff;\">ID</span> <span style=\"color: #000000;\">716</span> <span style=\"color: #0000ff;\">OF</span> oDlg <span style=\"color: #0000ff;\">ACTION</span><span style=\"color: #000000;\">(</span> oDlg:<span style=\"color: #000000;\">End</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /><br /><br /><br /><br /><br /> <span style=\"color: #0000ff;\">ACTIVATE</span> <span style=\"color: #0000ff;\">DIALOG</span> oDlg <span style=\"color: #0000ff;\">CENTERED</span> <span style=\"color: #0000ff;\">ON</span> <span style=\"color: #0000ff;\">INIT</span> oBrowse:<span style=\"color: #000000;\">SetFocus</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /><br /> ado_CierraRecordSet<span style=\"color: #000000;\">(</span> @oRs <span style=\"color: #000000;\">)</span><br /><br /><br /><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><br /><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><span style=\"color: #B900B9;\">// Función ....: AltasApuntes</span><br /><span style=\"color: #B900B9;\">// Descripción : A¤adimos un registro a la base de datos.</span><br /><span style=\"color: #B900B9;\">// Variables ..: lLogico -> valor l¢gico, para no duplicar c¢digos.</span><br /><span style=\"color: #B900B9;\">// nCodigo -> para comprobar c¢digos mediante b£squeda.</span><br /><span style=\"color: #B900B9;\">// Notas ......: Comprobamos que el c¢digo introducido sea uno de nuevo.</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><span style=\"color: #00C800;\">FUNCTION</span> AltasApuntes<span style=\"color: #000000;\">(</span> lAppend, nRegistro <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">LOCAL</span> oDlg <span style=\"color: #B900B9;\">// Objeto Diálogo</span><br /> <span style=\"color: #00C800;\">LOCAL</span> oRs, oData, oError<br /> <span style=\"color: #00C800;\">LOCAL</span> lSave := .F. <span style=\"color: #B900B9;\">// Grabado</span><br /><br /><br /> <span style=\"color: #00C800;\">DEFAULT</span> lAppend := .F. <span style=\"color: #B900B9;\">// Añadir</span><br /><br /><br /><br /><br /><br /><br /> <span style=\"color: #B900B9;\">//</span><br /> <span style=\"color: #B900B9;\">// Seleccionamos RecordSet</span><br /> <span style=\"color: #B900B9;\">//-------------------------</span><br /> oRs := ado_AbreRecordSet<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"select * from APUNTES order by FECHA ASC\"</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">IF</span> oRs = <span style=\"color: #00C800;\">nil</span><br /> <span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /> <span style=\"color: #00C800;\">ENDIF</span><br /><br /><br /><br /><br /><br /> <span style=\"color: #00C800;\">IF</span> lAppend <span style=\"color: #B900B9;\">// Si hay que añadir</span><br /> oData := TDataRow<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>:<span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">(</span> oRs, <span style=\"color: #00C800;\">nil</span>, .t. <span style=\"color: #000000;\">)</span><br /><br /> oData:<span style=\"color: #000000;\">Fecha</span> := Date<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /> oData:<span style=\"color: #000000;\">Apunte</span> := <span style=\"color: #ff0000;\">\"test sample in SUNDAY \"</span>+cvalToChar<span style=\"color: #000000;\">(</span>datetime<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><span style=\"color: #000000;\">)</span><br /> oData:<span style=\"color: #000000;\">nIngreso</span> := nrandom<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">10</span><span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">ENDIF</span><br /><br /><br /> oData:<span style=\"color: #000000;\">Save</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /><br /> alert<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"added new record\"</span>+CRLF+CRLF+oData:<span style=\"color: #000000;\">Apunte</span><span style=\"color: #000000;\">)</span><br /><br /><br /><br /><br /> ado_CierraRecordSet<span style=\"color: #000000;\">(</span> @oRs <span style=\"color: #000000;\">)</span><br /><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">// ---------------------------------------------------------------------------</span><br /><br /><br /><br /><br /><br /><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #00C800;\">FUNCTION</span> ado_String<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /> <span style=\"color: #00C800;\">LOCAL</span> cMotor := <span style=\"color: #ff0000;\">\"MSACCESS\"</span><br /><br /> <span style=\"color: #00C800;\">LOCAL</span> cBD := HB_DIRBASE<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>+<span style=\"color: #ff0000;\">\"ACCESS.MDB\"</span><br /><br /><br /><br /> <span style=\"color: #00C800;\">DO</span> <span style=\"color: #00C800;\">CASE</span><br /> <span style=\"color: #00C800;\">CASE</span> cMotor == <span style=\"color: #ff0000;\">\"MSACCESS\"</span><br /> cStr := <span style=\"color: #ff0000;\">'Provider='</span>+<span style=\"color: #ff0000;\">\"Microsoft.Jet.OLEDB.4.0\"</span>+<span style=\"color: #ff0000;\">';Data Source='</span>+cBD<br /><br /><br /> <span style=\"color: #00C800;\">CASE</span> cMotor == <span style=\"color: #ff0000;\">\"MYSQL\"</span><br /> cStr := <span style=\"color: #ff0000;\">\"Driver={MySQL ODBC 3.51 Driver};Server=dolphintest.sitasoft.net;\"</span> + ;<br /> <span style=\"color: #ff0000;\">\"Database=dolphin_man;User=test_dolphin;Password=123456;Option=3;\"</span><br /><br /><br /> <span style=\"color: #00C800;\">ENDCASE</span><br /><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> cStr<br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><br /><br /><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #B900B9;\">//</span><br /><span style=\"color: #B900B9;\">// FUNCIONES PARA EL MANEJO DE RECORDSET</span><br /><span style=\"color: #B900B9;\">// -------------------------------------</span><br /><span style=\"color: #B900B9;\">//</span><br /><span style=\"color: #B900B9;\">//</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #00C800;\">FUNCTION</span> ado_AbreRecordSet<span style=\"color: #000000;\">(</span> cSQL <span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /> <span style=\"color: #00C800;\">LOCAL</span> oError<br /><br /> <span style=\"color: #00C800;\">DEFAULT</span> cSQL := <span style=\"color: #ff0000;\">\"SELECT * From TablaInexistente\"</span><br /><br /><br /><br /> <span style=\"color: #B900B9;\">// open a recordset on demand with sql statement and connection string</span><br /> oRsUser := TOleAuto<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span>:<span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"ADODB.Recordset\"</span> <span style=\"color: #000000;\">)</span><br /> oRsUser:<span style=\"color: #000000;\">CursorType</span> := <span style=\"color: #000000;\">1</span> <span style=\"color: #B900B9;\">// opendkeyset</span><br /> oRsUser:<span style=\"color: #000000;\">CursorLocation</span> := <span style=\"color: #000000;\">3</span> <span style=\"color: #B900B9;\">// local cache</span><br /> oRsUser:<span style=\"color: #000000;\">LockType</span> := <span style=\"color: #000000;\">3</span> <span style=\"color: #B900B9;\">// lockoportunistic</span><br /><br /><br /> <span style=\"color: #00C800;\">TRY</span><br /> oRsUser:<span style=\"color: #000000;\">Open</span><span style=\"color: #000000;\">(</span> cSQL, cStr <span style=\"color: #000000;\">)</span><br /> oCn := oRsUser:<span style=\"color: #000000;\">ActiveConnection</span><br /> oRdbms := FW_RDBMSName<span style=\"color: #000000;\">(</span> oCn <span style=\"color: #000000;\">)</span><br /><br /> CATCH oError<br /> ado_ErrorNoRecordSet<span style=\"color: #000000;\">(</span>oError<span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">// Mensaje de Error</span><br /> oRsUser := <span style=\"color: #00C800;\">nil</span><br /> END<br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> oRsUser<br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #00C800;\">FUNCTION</span> ado_CierraRecordSet<span style=\"color: #000000;\">(</span> oRs <span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /> <span style=\"color: #00C800;\">local</span> oErr<br /><br /><br /> <span style=\"color: #00C800;\">TRY</span><br /> oRs:<span style=\"color: #000000;\">Close</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /> oRs := <span style=\"color: #00C800;\">Nil</span><br /> CATCH oErr<br /> ado_ErrorNoRecordSet<span style=\"color: #000000;\">(</span>oErr<span style=\"color: #000000;\">)</span><br /> END<br /><br /><br /><br /> oRs := <span style=\"color: #00C800;\">Nil</span><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #00C800;\">FUNCTION</span> ado_Borrar<span style=\"color: #000000;\">(</span> oRs <span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /> <span style=\"color: #00C800;\">LOCAL</span> n<br /> <span style=\"color: #00C800;\">LOCAL</span> oErr1, oErr2, oErr3<br /><br /><br /><br /> <span style=\"color: #00C800;\">if</span> MsgYesNo<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"¿ Desea BORRAR este Registro ?.\"</span>+CRLF+CRLF+<span style=\"color: #ff0000;\">\"Si tiene dudas, seleccione No.\"</span>, <span style=\"color: #ff0000;\">\" B O R R A R R E G I S T R O\"</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">if</span> oRs:<span style=\"color: #000000;\">RecordCount</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> = <span style=\"color: #000000;\">0</span><br /> MsgAlert<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ERROR: No hay ningún registro en la tabla.\"</span>+CRLF+CRLF+<span style=\"color: #ff0000;\">\"No hay nada que BORRAR.\"</span>, <span style=\"color: #ff0000;\">\" E R R O R \"</span><span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /> n := oRs:<span style=\"color: #000000;\">AbsolutePosition</span><br /><br /><br /> <span style=\"color: #00C800;\">try</span><br /> oRs:<span style=\"color: #000000;\">Delete</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /> catch oErr1<br /> MsgStop<span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"ERROR: No se ha podido ejecutar la operación de borrado.\"</span>+CRLF+CRLF+oErr1:<span style=\"color: #000000;\">Description</span>, <span style=\"color: #ff0000;\">\" E R R O R \"</span><span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">return</span><span style=\"color: #000000;\">(</span>.f.<span style=\"color: #000000;\">)</span><br /> end<br /><br /><br /> <span style=\"color: #B900B9;\">///oRs:Update()</span><br /><br /><br /> <span style=\"color: #00C800;\">If</span> !oRs:<span style=\"color: #000000;\">RecordCount</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> = <span style=\"color: #000000;\">0</span><br /> oRs:<span style=\"color: #000000;\">AbsolutePosition</span> := <span style=\"color: #0000ff;\">Min</span><span style=\"color: #000000;\">(</span> n, oRs:<span style=\"color: #000000;\">RecordCount</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /><br /> <span style=\"color: #0000ff;\">MsgInfo</span><span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"El Registro ha sido BORRADO correctamente.\"</span>, <span style=\"color: #ff0000;\">\" A V I S O \"</span><span style=\"color: #000000;\">)</span><br /><br /><br /> <span style=\"color: #00C800;\">else</span><br /> <span style=\"color: #0000ff;\">MsgInfo</span><span style=\"color: #000000;\">(</span><span style=\"color: #ff0000;\">\"El USUARIO ha cancelado la operación de Borrar.\"</span>, <span style=\"color: #ff0000;\">\" A V I S O \"</span><span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">endif</span><br /><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><span style=\"color: #00C800;\">FUNCTION</span> ado_ErrorNoRecordSet<span style=\"color: #000000;\">(</span>oErr<span style=\"color: #000000;\">)</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /> <span style=\"color: #B900B9;\">//local nErr, oErr, cErr</span><br /> <span style=\"color: #00C800;\">local</span> cErr<br /> <span style=\"color: #00C800;\">local</span> oConexion := oCn<br /> <span style=\"color: #00C800;\">local</span> cInstruccion := <span style=\"color: #ff0000;\">\"\"</span> <span style=\"color: #B900B9;\">//oErr:Args[1]</span><br /><br /><br /> <span style=\"color: #B900B9;\">//</span><br /> <span style=\"color: #B900B9;\">// fix oErr:Args[1], a veces está vacío</span><br /> <span style=\"color: #B900B9;\">//--------------------------------------</span><br /> <span style=\"color: #00C800;\">if</span> HB_IsNil<span style=\"color: #000000;\">(</span> oErr:<span style=\"color: #000000;\">Args</span> <span style=\"color: #000000;\">)</span><br /> cInstruccion := space<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">else</span><br /> cInstruccion := oErr:<span style=\"color: #000000;\">Args</span><span style=\"color: #000000;\">[</span><span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">]</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /><br /><br /> <span style=\"color: #B900B9;\">//if ( nErr := oConexion:Errors:Count ) > 0</span><br /> <span style=\"color: #B900B9;\">// oErr := oConexion:Errors( nErr - 1 )</span><br /> WITH OBJECT oErr<br /> cErr := <span style=\"color: #ff0000;\">\"No se puede ejecutar la instrucción \"</span> + cValToChar<span style=\"color: #000000;\">(</span> cInstruccion <span style=\"color: #000000;\">)</span><br /> cErr += CRLF+CRLF+oErr:<span style=\"color: #000000;\">Description</span><br /> cErr += CRLF+CRLF + <span style=\"color: #ff0000;\">'Operación : '</span> + cValToChar<span style=\"color: #000000;\">(</span> oErr:<span style=\"color: #000000;\">Operation</span> <span style=\"color: #000000;\">)</span><br /> cErr += CRLF+CRLF + <span style=\"color: #ff0000;\">'Fuente del Error : '</span> + cValToChar<span style=\"color: #000000;\">(</span> oErr:<span style=\"color: #000000;\">Filename</span> <span style=\"color: #000000;\">)</span><br /><br /> MsgAlert<span style=\"color: #000000;\">(</span> cErr, <span style=\"color: #ff0000;\">\"ADO ERROR RecordSet\"</span> <span style=\"color: #000000;\">)</span><br /> END<br /> <span style=\"color: #B900B9;\">//else</span><br /> <span style=\"color: #B900B9;\">// MsgAlert( \"ADO ERROR desconocido.\" )</span><br /> <span style=\"color: #B900B9;\">//endif</span><br /><br /><br /><span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><span style=\"color: #B900B9;\">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><br />*-------------------------------------------------------------------------------<br /><span style=\"color: #00C800;\">FUNCTION</span> ADO_RecCount<span style=\"color: #000000;\">(</span>oRs<span style=\"color: #000000;\">)</span><br />*-------------------------------------------------------------------------------<br /><br /> <span style=\"color: #00C800;\">local</span> nRecord := <span style=\"color: #000000;\">0</span><br /><br /> nRecord := oRs:<span style=\"color: #000000;\">AbsolutePosition</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /> nRecord := iif<span style=\"color: #000000;\">(</span>nRecord=<span style=\"color: #00C800;\">nil</span>,<span style=\"color: #000000;\">-1</span>,nRecord<span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">if</span> nRecord < <span style=\"color: #000000;\">1</span><br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #000000;\">0</span><br /> <span style=\"color: #00C800;\">else</span><br /> <span style=\"color: #00C800;\">return</span> oRs:<span style=\"color: #000000;\">RecordCount</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #000000;\">0</span><br />*-------------------------------------------------------------------------------<br /><br /><br /><br /> </div>[/code:1q01ldrs]\n\n\n\n.rc file:\n[code=fw:1q01ldrs]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <windows.h><br /><span style=\"color: #00D7D7;\">#include</span> <commctrl.h><br /><br /><br /><br />APUNTES <span style=\"color: #0000ff;\">DIALOG</span> <span style=\"color: #000000;\">-3</span>, <span style=\"color: #000000;\">1</span>, <span style=\"color: #000000;\">516</span>, <span style=\"color: #000000;\">289</span><br /><span style=\"color: #0000ff;\">STYLE</span> 0x4L <br />CAPTION <span style=\"color: #ff0000;\">\"BROWSE\"</span><br /><span style=\"color: #0000ff;\">FONT</span> <span style=\"color: #000000;\">8</span>, <span style=\"color: #ff0000;\">\"MS Sans Serif\"</span><br /><span style=\"color: #000000;\">{</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Añadir\"</span>, <span style=\"color: #000000;\">711</span>, <span style=\"color: #000000;\">30</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Borrar\"</span>, <span style=\"color: #000000;\">712</span>, <span style=\"color: #000000;\">92</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Modificar\"</span>, <span style=\"color: #000000;\">713</span>, <span style=\"color: #000000;\">154</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Filtrar\"</span>, <span style=\"color: #000000;\">714</span>, <span style=\"color: #000000;\">216</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Imprimir\"</span>, <span style=\"color: #000000;\">715</span>, <span style=\"color: #000000;\">278</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> PUSHBUTTON <span style=\"color: #ff0000;\">\"&Salir\"</span>, <span style=\"color: #000000;\">716</span>, <span style=\"color: #000000;\">444</span>, <span style=\"color: #000000;\">260</span>, <span style=\"color: #000000;\">54</span>, <span style=\"color: #000000;\">14</span><br /> CONTROL <span style=\"color: #ff0000;\">\"\"</span>, <span style=\"color: #000000;\">101</span>, <span style=\"color: #ff0000;\">\"TXBrowse\"</span>, <span style=\"color: #000000;\">0</span> | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, <span style=\"color: #000000;\">18</span>, <span style=\"color: #000000;\">18</span>, <span style=\"color: #000000;\">480</span>, <span style=\"color: #000000;\">228</span><br /><span style=\"color: #000000;\">}</span><br /><br /><br /> </div>[/code:1q01ldrs]",
"time": "14:40",
"topic": "ADO question: Access is not refresing properly",
"username": "lucasdebeltran"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Lucas,\n\n[quote=\"lucasdebeltran\":1qqyawcl]Just click on Añadir, and you will see that oRs is not updated:[/quote:1qqyawcl]\n\nTry using adOpenDynamic:\n\n[url:1qqyawcl]http://www.w3schools.com/ado/met_rs_open.asp[/url:1qqyawcl]\n\nEMG",
"time": "16:17",
"topic": "ADO question: Access is not refresing properly",
"username": "Enrico Maria Giordano"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Lucas\n\nYou define oRs as your recordset for your xBrowse .. when you create a record .. pass oRs, and oBrowse to your add routine and DO NOT redefine oRs as local in that add routine.\n\noRs Represents the data that can be passed as a parameter .. in your add routine just oRs:AddNew() ( modify your fields ) .. and oRs:Update() then oBrowse:ReFresh() .. \n\noRs:ReQuery() is only helpful when you have a COMPLEX join in your recordset and adding or deleting a record to that complex oRs will cause un-intended consequences to those joined tables. IN that situation .. you can create a new recordset .. add your record and then oRs:Requery() the original recordset to make your new row visible.\n\nRick Lipkin",
"time": "16:21",
"topic": "ADO question: Access is not refresing properly",
"username": "Rick Lipkin"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Enrico,\n\nThank you, I am going to test it.\n\n\nRick,\n\nI need to have an independant oRs in Add function -Añadir()-, as the add function can also be called out of the xBrowse.\n\nSo the strange think is that, despite the two Recordsets, Access do not refresh them sometimes at instant.\n\nHave you tested my sample?.\n\nThank you. best regards",
"time": "18:44",
"topic": "ADO question: Access is not refresing properly",
"username": "lucasdebeltran"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote:1yakhzd4]Try using adOpenDynamic:\n\n<!-- m --><a class=\"postlink\" href=\"http://www.w3schools.com/ado/met_rs_open.asp\">http://www.w3schools.com/ado/met_rs_open.asp</a><!-- m -->\n\nEMG[/quote:1yakhzd4]\n\nNo effect, the same problem . \n\nThanks.",
"time": "20:36",
"topic": "ADO question: Access is not refresing properly",
"username": "lucasdebeltran"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Lucas,\n\n[quote=\"lucasdebeltran\":3q1xlofc][quote:3q1xlofc]Try using adOpenDynamic:\n\n<!-- m --><a class=\"postlink\" href=\"http://www.w3schools.com/ado/met_rs_open.asp\">http://www.w3schools.com/ado/met_rs_open.asp</a><!-- m -->\n\nEMG[/quote:3q1xlofc]\n\nNo effect, the same problem . \n\nThanks.[/quote:3q1xlofc]\n\nDid you read the article? This is expected behavior for adOpenKeySet:\n\n[quote:3q1xlofc]you can't see records that other users add[/quote:3q1xlofc]\n\nEMG",
"time": "20:42",
"topic": "ADO question: Access is not refresing properly",
"username": "Enrico Maria Giordano"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Yes, I did and I tested it with no luck.\n\nBut when you add another record, the second, I see both after oRs:Requery().\n\nWith other RDDS I don´t have this problem.\n\nQuite strange.",
"time": "21:53",
"topic": "ADO question: Access is not refresing properly",
"username": "lucasdebeltran"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2013-06-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Mr Lucas\n\nI am sending you a sample program to your personal e-mail. This is a modified version of the program you sent me. ReQuery is working perfectly here for me.\nPlease test it at your end and let me know the results.",
"time": "05:11",
"topic": "ADO question: Access is not refresing properly",
"username": "nageswaragunupudi"
}
] |
ADO question: Access is not refresing properly
|
[
{
"date": "2006-04-01",
"forum": "FiveWin para Harbour/xHarbour",
"text": "cuando esta la tabla vacia ado marca error , sera que ado no maneja el record fantasma como se le llama.\n\n\nsaludos.\nfernando sandoval ruiz",
"time": "00:08",
"topic": "ADO record fantasma",
"username": "fsandoval"
}
] |
ADO record fantasma
|
[
{
"date": "2006-04-01",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Que yo sepa, las tablas SQL no tienen \"registro fantasma\" como los DBFs, si en un EXECUTE() de ADO no te regresa ningun dato, es simplemente que la tabla esta vacia",
"time": "04:39",
"topic": "ADO record fantasma",
"username": "R.F."
}
] |
ADO record fantasma
|
[
{
"date": "2006-04-03",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Fernando,\n\n[quote:2402dxpz]cuando esta la tabla vacia ado marca error , sera que ado no maneja el record fantasma como se le llama.[/quote:2402dxpz]\n\nADO te marcará siempre error cuando intentas hacer alguna operación y en esa operación no hay registro activo. Como buena costumbre, verifica si hay registros de dos maneras: con la propiedad recordcount y mirando si oRs:BOF() .AND. oRs:EOF() se cumple.\n\nSaludos,\nJosé Luis Capel",
"time": "08:54",
"topic": "ADO record fantasma",
"username": "jlcapel"
}
] |
ADO record fantasma
|
[
{
"date": "2006-04-03",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Gracias, me lo sospeche, pero bueno hay trucos para bricar estas cosas.\n\n\n\nsaludos.\nfernando sandoval ruiz",
"time": "21:08",
"topic": "ADO record fantasma",
"username": "fsandoval"
}
] |
ADO record fantasma
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I would like to start a thread to discuss the way you manage record locking using ADO.\n\nMy question is simple:\n\nLets say that you have a record, and that you need to edit it and meanwhile you edit it, other users should not be able to edit it.\n\nHow are you managing this situation ?\n\nI appreciate your comments",
"time": "05:23",
"topic": "ADO record locking experiences",
"username": "Antonio Linares"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI have created a table 'FILELOCK' in my SQL table, with a field 'table','table_id','user','pcname'.\nWhen I want to lock a record, I write te table,record-ID, user and PC-name to that table. (I created a function SQLLock)\n\nAn other user that want to open the record check with a function SQLlock that the record is available.\nIf not, it returns FALSE, otherwhise is locks the record by writing the info to the table FILELOCK.\n\nI use the info USER and PCNAME, so I can display the purson who have locked the record...\n\nSo my function SQLlock works the same as rlock()\n\nIf I want to unlock the record, I delete the record in FILELOCK.",
"time": "07:42",
"topic": "ADO record locking experiences",
"username": "Marc Vanzegbroeck"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio\n\nI use a numeric signature file in the table that gets incremented +1 each time I save a record... user one fetches a record that has a current value ( lets say ) 1 and before I UpDate() that record, I have a function that opens a new recordset just on the rows primary key ( or rowid ) and the Signature field to check its value.\n\nIf the Value is the same, I know no one has modified the record before I did. If the value has changed, then I know my edit has become 'stale' and someone has modified the same record before I did, in which case I cancel the Edit with a message like \"Sorry .. someone has modified the record you are trying to change\"....\n\nRick Lipkin\n\nps .. this assumes you buffer all your fields to memory values when you first read a record.",
"time": "14:09",
"topic": "ADO record locking experiences",
"username": "Rick Lipkin"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc, Rick,\n\nAnd how do you control if a user gets disconnected without releasing the locked record (using any of your techniques) ?\n\nIn that situation the record would appear as locked but in fact nobody is locking it anymore...",
"time": "16:02",
"topic": "ADO record locking experiences",
"username": "Antonio Linares"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio\n\nI do not look for a lock .. whom ever gets to update the record first gets the Signature field+1 Update(). Then if workstation two tries to update the same record .. Within the Update() routine, I create a new recordset on the unique rowid ( primary key ) and see if the signature field matches .. if it doesn't .. I stop workstation 2 from Update() forcing them to cancel their edit and try again.\n\nIn the case of a disconnect .. that record never got it signature field updated+1 so when workstation 2 tries to update .. the signature field matches and WS two gets the update.\n\nIf WS 1 comes back online .. more than likely they would have had to re-boot and would have to go back into the program afterward WS 2 made their changes.\n\nHope you understand my logic ?\n\nRick Lipkin",
"time": "18:45",
"topic": "ADO record locking experiences",
"username": "Rick Lipkin"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"Antonio Linares\":14grxcav]Marc, Rick,\n\nAnd how do you control if a user gets disconnected without releasing the locked record (using any of your techniques) ?\n\nIn that situation the record would appear as locked but in fact nobody is locking it anymore...[/quote:14grxcav]\n\nAntonio,\n\nIf someone start the program, the program removes first all locks of that PC.\nThe records are indeed locked if the program have crashed. After restarting the program, all locks are removed.\nAt the moment, I'm modifiying my function, so it look for all users that are connected with the database.\nThe Recordset-command that I use now is\n[code=fw:14grxcav]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #0000ff;\">SELECT</span> SUBSTRING_INDEX<span style=\"color: #000000;\">(</span>host, <span style=\"color: #ff0000;\">':'</span>, <span style=\"color: #000000;\">1</span><span style=\"color: #000000;\">)</span> AS host_short <span style=\"color: #0000ff;\">FROM</span> information_schema.processlist <span style=\"color: #0000ff;\">WHERE</span> db = <span style=\"color: #ff0000;\">\"MyProgram\"</span> GROUP BY host_short ORDER BY host_short</div>[/code:14grxcav]\n\nThen I get a list af all connections.\nI will let you know the result...",
"time": "18:56",
"topic": "ADO record locking experiences",
"username": "Marc Vanzegbroeck"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nBut if u dont reconect then register to continue lock, or if u reconnect with another pc its the same... \n\nGood thread",
"time": "19:17",
"topic": "ADO record locking experiences",
"username": "Carles"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"Carles\":1qp0h4f5]Marc,\n\nBut if u dont reconect then register to continue lock, or if u reconnect with another pc its the same... \n\nGood thread[/quote:1qp0h4f5]\n\nCharles,\n\nThat's the reason why I'm modifying my function.\nIf I want to lock a record that is locked by someone else, I will run the query that check if the user is still connected, and then delete the records if it is disconnected..",
"time": "19:23",
"topic": "ADO record locking experiences",
"username": "Marc Vanzegbroeck"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Marc,\n\nNow i'm undertsand the process. Exist this table in all rdbm ?",
"time": "19:35",
"topic": "ADO record locking experiences",
"username": "Carles"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\n[quote=\"Antonio Linares\":36q6evsr]I would like to start a thread to discuss the way you manage record locking using ADO.\n\nMy question is simple:\n\nLets say that you have a record, and that you need to edit it and meanwhile you edit it, other users should not be able to edit it.\n\nHow are you managing this situation ?\n\nI appreciate your comments[/quote:36q6evsr]\n\nYou have to use pessimistic locking and error trapping. This is the way ADO works.\n\nEMG",
"time": "16:31",
"topic": "ADO record locking experiences",
"username": "Enrico Maria Giordano"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Enrico,\n\nCould you post an example ? thanks",
"time": "19:42",
"topic": "ADO record locking experiences",
"username": "Antonio Linares"
}
] |
ADO record locking experiences
|
[
{
"date": "2014-08-23",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nplease look at LockType property:\n\n[url:1lnw53nd]http://www.w3schools.com/ado/prop_rs_locktype.asp[/url:1lnw53nd]\n\nIf you set it to adLockPessimistic, the second user trying to assign a value to the record, before the first one have called update method, will get a runtime error. With adLockOptimistic the lock is only on update call. You can use one of the two modes. Or you can lost yourself among the many DIY solutions. <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\nEMG",
"time": "20:15",
"topic": "ADO record locking experiences",
"username": "Enrico Maria Giordano"
}
] |
ADO record locking experiences
|
[
{
"date": "2007-08-08",
"forum": "FiveWin for Harbour/xHarbour",
"text": "To All\n\nI have a wierd situation where I have a very successful ADO xHarbour\\FWH application ( executable ) which resides on a Win2003 server.\n\nWhen the users run the executable from the server ( shortcut on their pc ) the application connects to the off site SQL server and runs flawlessly.\n\nHowever .. if you are at the server console ( physically at the server ) .. \nand you run the same application ( on the server ) it will start but fail to \nconnect to the first table.\n\nTotally exhausted here trying to find an answer .. I have found Google ideas on adding Persistant Security Info=False to no avail.\n\nHere is the connection string :\n\noRs := TOleAuto():New( \"ADODB.Recordset\" )\noRs:CursorType := 1 // opendkeyset\noRs:CursorLocation := 3 // local cache\noRs:LockType := 3 // lockoportunistic\n\ncSQL := \"SELECT * FROM utility WHERE progid ='\"+xPROGID+\"'\"\nTRY\n oRS:Open(cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial \nCatalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD )\nCATCH oErr\n MsgInfo( \"Error in Opening UTILITY CRASH BURN table\" ) /// dies here\n RETURN NIL\nEND TRY\n\nAgain .. this app runs the executable flawlessly as a shortcut on the \nworkstation .. but the same app will not run sitting at the server running \nthe app ON the server ??\n\nIt seems to me that the Server is breaking the connection string and I just don't know what to change or to try as far as 'trusted sites' perhaps or some other Win2003 process that is keeping this app from connecting to the off site Sql Server.\n\nHope that makes sense. Any help would be appreciated.\n\nRick Lipkin\nSC Dept of Health, USA",
"time": "00:34",
"topic": "ADO sqloledb conection problem",
"username": "Rick Lipkin"
}
] |
ADO sqloledb conection problem
|
[
{
"date": "2007-08-08",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rick:\n\nJust an idea that came into me actually.\n\nI think It could be the SQL Sever configurarion, I dunno if there's a parameter that let you allow the configuracion from the server.\n\nIn other database I've used before, you have to grant acces to the SYSTEM user in order to be able to connect from the console of the server instead from a workstation.\n\nJust an idea.",
"time": "01:14",
"topic": "ADO sqloledb conection problem",
"username": "R.F."
}
] |
ADO sqloledb conection problem
|
[
{
"date": "2007-08-08",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rene\n\nI am thinking along the same lines .. here is the actual example .. we have a 2003 server as a Citrix remote access box .. the server acts like a workstation and logs into a Novell server that has the executable in question.\n\nWhen you click on the short-cut the application noticibly starts .. but when the execution hits the first connection string .. it times out.\n\nI decided to take Novell out of the picture and just take a pure 2003 server and put the ADO app on a share .. connecting to the share with a unc .. from my workstation .. the application runs flawlessly... Now, go to the server and drill to the share and the app and try to run it .. and that is where it breaks.\n\nThere is a a definite Server 2003 process that is intefearing with the ADO connection to the SQL server .. which is off site by the way.\n\nSo I am really looking for a silver bullet that will allow the application to run from the server console. We have over 5000 people in the Agency and this application is the Time and Reporting system.. Many of the folks tele-commute and access the program from Citrix .. thus bringing this problem to the forefront.\n\nThere has to be something in the Server that is breaking the connection .. just don't know what ..\n\nRick Lipkin",
"time": "01:48",
"topic": "ADO sqloledb conection problem",
"username": "Rick Lipkin"
}
] |
ADO sqloledb conection problem
|
[
{
"date": "2007-08-09",
"forum": "FiveWin for Harbour/xHarbour",
"text": "To All\n\nThis has been fixed .. turned out to be a DNS problem on the Win2003 servers ..\n\nThanks\nRick Lipkin",
"time": "18:35",
"topic": "ADO sqloledb conection problem",
"username": "Rick Lipkin"
}
] |
ADO sqloledb conection problem
|
[
{
"date": "2013-08-14",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Buen dia para todos,\n\nEstoy usando ADO para trabajar con SQL Server 2008.\n\nEstoy intentando conectarme con SQL server 2008 desde un equipo a el Servidor SQL Server 2008 sin lograrlo.\n\nEn modo local me funciona el siguiente string de conexion (si me conecta) : \n\n Provider=SQLNCLI10;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;\n\nPero en modo remoto no funciona (es decir probando desde otro equipo)\n\nLa conexion a el servidor SQL lo tengo como autenticacion de windows (por defecto).\n\nQue string debo usar para la conexion remota ?\n\nQue debo configurar en el servidor SQL 2008 para que me de conexion remota ?\n\nDesde ya muchas gracias,\n\nSaludos Cordiales.",
"time": "19:05",
"topic": "ADO string de conexion SQL Server 2008 ?",
"username": "albeiroval"
}
] |
ADO string de conexion SQL Server 2008 ?
|
[
{
"date": "2013-08-15",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Hola,\n\nyo lo hice asi :\n\ncString:= \"Provider=SQLOLEDB;server=\"+cServer+\";database=\"+cDataBase+\";uid=\"+cUser+\";pwd=\"+cPass\n\n oCnx:=TAdoConn():New( adUseServer )\n if !oCnx:Open(xConnStr)\n msginfo( 'String: ' + xConnStr + CRLF +;\n 'No hay conexión con el Servidor...')\n RETURN NIL\n else\n msginfo(\"Conectado\")\n endif\n\nEspero te sirva...\nSalu2, Ariel.",
"time": "04:35",
"topic": "ADO string de conexion SQL Server 2008 ?",
"username": "Ariel"
}
] |
ADO string de conexion SQL Server 2008 ?
|
[
{
"date": "2013-08-15",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Ariel,\n\nGracias, voy a probarlo.\n\nAlbeiro.",
"time": "18:06",
"topic": "ADO string de conexion SQL Server 2008 ?",
"username": "albeiroval"
}
] |
ADO string de conexion SQL Server 2008 ?
|
[
{
"date": "2007-06-20",
"forum": "FiveWin for Harbour/xHarbour",
"text": "To All\n\nI have completed a major SQL ADO application and am finding that workstation recordsets are not being updated as other workstations make changes.\n\nI am caching the recordsets to the local client ..\n\nIn looking on MSDN I see a ReSync method ?? has anyone used this to just resync a specific record in a recodset ?? The documentation seems to support the single table record refresh .. I would think the syntax would be :\n\noRs:ReSync()\n\nIssue that and the object record will be refreshed from the table and included in the client cache ??\n\nRick Lipkin\nSC Dept of Health, USA\n\n\ncSQL := \"SELECT * FROM CERT order by reg_no\"\n\noRs := TOleAuto():New( \"ADODB.Recordset\" )\noRs:CursorType := 1 // opendkeyset\noRs:CursorLocation := 3 // local cache\noRs:LockType := 3 // lockoportunistic\n\nTRY\n oRs:Open( cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD )\nCATCH oErr\n MsgInfo( \"Error in Opening CERT table\" )\n oDlg:End()\n RETURN(.F.)\nEND TRY",
"time": "23:26",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-21",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rick:\n\nYour cursor type is wrong, you must use adOpenDynamic (2) in order to see changes others make in the recordset.\n\nHowever not all the databases support the dynamic update of the recordset.",
"time": "02:44",
"topic": "ADO update visability between workstations",
"username": "R.F."
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-21",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rene\n\nAccording to the doccumentation I found :\n\n(1)adOpenKeyset: A static snap-shot of the primary key values of the records that match your search criteria are put into the recordset. As you scroll backwards and forwards, the primary key value in the recordset is used to fetch the current data for that record from the database. This cursor thus allows you to see updates to the data made by other users, but it doesn't let you see new records that have been added by other users (because the primary key values for those records are not in your recordset).\n\n(2)adOpenDynamic: A dynamic snapshot of the database is maintained by OLEDB/ADO. All changes by other users to the underlying database are visible. Obviously this is the most sophisticated cursor, and thus is usually the most expensive. Because the data in the recordset is dynamic,\n attributes like AbsolutePosition and AbsolutePage can not be set. The adOpenDynamic cursor is not supported by the Jet OLEDB Provider.\n\n\nAbsolutePosition I need for the skipper in the listbox .. that is why I chose OpenKeyset .. I have not tried OpenDynamic .. I can easily try it .. I did find a Resync method which seems to be my answer ... I am in 'un-charted' territory .. just curious if you have used Resync() .. and what the syntax would look like ?? oRs:ReSync() ?? when I open a record to view or edit ??\n\nRick Lipkin\n\n\noRs := TOleAuto():New( \"ADODB.Recordset\" )\noRs:CursorType := 1 // opendkeyset\noRs:CursorLocation := 3 // local cache\noRs:LockType := 3 // lockoportunistic\n\ncSQL := \"SELECT * FROM USERINFO order by USERID\"\n\nTRY\n\n oRs:Open( cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD )\n\nCATCH oErr\n MsgInfo( \"Error in Opening USERINFO table\" )\n RETURN(.F.)\nEND TRY\n\noRs:Find(\"USERID = '\"+xLOGIN+\"'\" )\nIF oRs:eof\n oRs:MoveFirst()\nENDIF\n\nDEFINE WINDOW oUser ;\n FROM 2,2 to 25,65 ;\n of oWndMDI ;\n TITLE \"USERINFO Records Browse\" ;\n MENU BuildMenu(oRs) ;\n NOMINIMIZE ;\n NOZOOM ;\n MDICHILD\n\n@ 0, 0 LISTBOX oBrow FIELDS ;\n oRs:Fields(\"USERID\"):Value, ;\n oRs:Fields(\"READ\"):Value, ;\n oRs:Fields(\"WRITE\"):Value, ;\n oRs:Fields(\"INSP\"):Value, ;\n oRs:Fields(\"SUPER\"):Value, ;\n oRs:Fields(\"DISTRICT\"):Value ;\n SIZES 90,60,60,60,60,100 ;\n HEADERS \"Userid\", ;\n \"Read\", ;\n \"Write\", ;\n \"Insp\", ;\n \"Super\", ;\n \"Dist\" ;\n ON DBLCLICK _userview( \"V\" ) ;\n of oUser ;\n UPDATE\n\n oBrow:bLogicLen := { || oRs:RecordCount }\n oBrow:bGoTop := { || oRs:MoveFirst() }\n oBrow:bGoBottom := { || oRs:MoveLast() }\n oBrow:bSkip := { | nSkip | Skipper( oRs, nSkip ) }\n oBrow:cAlias := \"ARRAY\"\n\n oUSER:oClient := oBROW\n oUSER:SetControl( oBROW )\n\n ACTIVATE WINDOW oUser ;\n VALID ( IIF( !lOK, UserClose(.T., oRs), .F. ))\n\nRETURN( NIL )\n\n//-------------------------------\nSTATIC FUNCTION SKIPPER( oRsx, nSkip )\n\nLOCAL nRec := oRsx:AbsolutePosition\n\noRsx:Move( nSkip )\n\nIF oRsx:EOF; oRsx:MoveLast(); ENDIF\nIF oRsx:BOF; oRsx:MoveFirst(); ENDIF\n\nRETURN( oRsx:AbsolutePosition - nRec )\n\n\n//-------------------------",
"time": "02:53",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-21",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rene\n\nChanging the open dynamic did not seem to work .. the recordset opened and I had a top and bottom to my listbox .. however .. there was no visability of updates .. don't think SQL server supports dynamic and it just opened it like it was static.\n\nThe Resync() option gave a run-time error unfortunitly .. I have implemented a signature field so I can stop a stale recordset from writing over updated records .. I may have to abandon the local caching of the recordset in favor of just pointing to the server .. going to take a hit in performance .. I may have to re-think how I am presenting the data to the users and force them to query a record each time for get a fresh recordset.\n\nAntonio .. I am using the same mechanism you are using in the ADO RDD with the same open methods .. have you tested multiple workstation visability ??\n\nRick Lipkin",
"time": "23:02",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rick, I want to thank you for sharing these valuable informations.\n\nEMG",
"time": "10:30",
"topic": "ADO update visability between workstations",
"username": "Enrico Maria Giordano"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Only a test, but seems work:\n\n[code:29d4yjr4]\n\n oRs := CREATEOBJECT( \"ADODB.Recordset\" )\n cSQL := \"SELECT * FROM Articoli ORDER BY codice ASC\"\n\n TRY\n oRs:Open( cSQL, oConnection, adOpenStatic, adLockOptimistic ) // 3, 3 \n\n CATCH oError\n MsgStop(oError:Operation+CRLF+oError:Description,\"Ado Connection\")\n RETURN NIL\n\n END TRY\n\n DEFINE TIMER oTimer;\n INTERVAL 1000;\n ACTION ( nTimer++, IIF( nTimer > 10, RefreshSQL( @nTimer, oTimer, oRs, oBrw ), \"\" ) ) OF oDlg\n ACTIVATE TIMER oTimer\n oTimer:deActivate()\n\n DEFINE DIALOG oDlg ;\n FROM 7,7 to 35,104 ;\n TITLE \"Articoli\"\n \n @ 0, 0 LISTBOX oBrw;\n FIELDS \"\", \"\", \"\", \"\", \"\";\n HEADERS \"Codice\", \"Descrizione\", \"Desc. Aggiuntiva\", \"Nota 1\", \"Nota 2\";\n OF oDlg\n\n oBrw:bLine := { || { oRs:Fields( \"codice\" ):Value, oRs:Fields( \"descrizione\" ):Value, oRs:Fields( \"descrizione_aggiuntiva\" ):Value, oRs:Fields( \"nota1\" ):Value, oRs:Fields( \"nota2\" ):Value } }\n oBrw:bLogicLen := { || oRs:RecordCount }\n oBrw:bGoTop := { || oRs:MoveFirst() }\n oBrw:bGoBottom := { || oRs:MoveLast() }\n oBrw:bSkip := { | nSkip | SkipperAdo( oRs, nSkip ) }\n oBrw:cAlias := \"\"\n \n ACTIVATE DIALOG oDlg;\n ON INIT ( oDlg:SetControl( oBrw ), nSecFine:= SECONDS(), InfStat( NTRIM( nSecFine-nSecIni ) + \" secondi... - \" + NTRIM( oRs:RecordCount ) + \" records...\" ), oTimer:activate() )\n\n oTimer:end()\n\n TRY\n oRs:Close()\n CATCH\n END TRY\n\n\n TRY\n oConnection:Close()\n CATCH\n END TRY\n\n\nRETURN NIL\n\n\nFUNCTION RefreshSQL( nTimer, oTimer, oRs, oBrw )\nLOCAL nRec := oRs:AbsolutePosition\n\n nTimer := 0\n oTimer:deActivate()\n CursorWait()\n\n TRY\n oRs:Requery()\n CATCH\n END TRY\n\n\n TRY\n oRs:Move( nRec-1 )\n CATCH\n END TRY\n\n oBrw:refresh()\n CursorArrow()\n oTimer:Activate()\n\nRETURN NIL\n\n[/code:29d4yjr4]",
"time": "11:16",
"topic": "ADO update visability between workstations",
"username": "pymsoft"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rick,\n\n>\nAntonio .. I am using the same mechanism you are using in the ADO RDD with the same open methods .. have you tested multiple workstation visability ?? \n>\n\nNo, sorry, we have just done local tests with it",
"time": "11:21",
"topic": "ADO update visability between workstations",
"username": "Antonio Linares"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-22",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Pedro\n\nI did see the ReQuery method .. however I would prefer not to re-query a full recordset .. Have you tried the ReSync method ?? Any ideas the syntax ??\n\nRick Lipkin",
"time": "15:33",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Resync for current record only:\n\n oRs:Resync( adAffectCurrent, adResyncAllValues )\n\nThere are times when Resync fails. (Discussion on this topic is too lengthy) Better put it in TRY CACH END construct and use ReQuery as alternative",
"time": "08:39",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Rick, \n\nResync method don't work to me. (in my tests allways fails, I'm a begginer with ADO)\nRequery seems to be fast (in a local net)\n\n\nRegards",
"time": "09:21",
"topic": "ADO update visability between workstations",
"username": "pymsoft"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "There was a discussion above to use adOpenDynamic or adOpenKeyset for opening a recordset. But when a recordset is opened on clientside (with cursorlocation as adUseClient) the provider ignores what we speicfy as CursorType (adOpenDynamic or Keyset), and returns a recordset with cursortype as adOpenStatic only.\n\nadOpenDynamic or adOpenKeyset cursortype is useful only for recorsets opened with cursor location adUseSever. Often this is not what we do.",
"time": "13:58",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "1 2\noRs:Resync( adAffectCurrent, adResyncAllValues ) \n\nExcellant .. that is what I was looking for .. I will definitly surround it with Try\\Catch .. and I will report back my success ..\n\nadAffectCurrent = 1\nadResyncAllValues = 2\n\nI have tried the above and it fails each time .. does it matter if the data has changed or not ??\n\nRick Lipkin",
"time": "15:04",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I work extensively with very large applications ADO and Oracle. My experience with MSSQL is limitted to smaller applications. Resync generally works even when the other users update the same row but occassionally fails. Better we keep in mind how Resync command internally works:\n\nRecordSet object has Properities collection.\noRs:Properties(\"Resync Command\"):Value is what ADO internally uses to retrieve the values of the current row. This value can be set by our program but i am not able to change this property through xharbour. (works in vbasic)\n\nADO has to know the primary key or some unique id of the row to internally construct this command. For example a table has two columns \"custid\", \"custname\" with custid as primary key and if ado can know this, it will internelly construct the resync command as \"select * from customers where custid = ?\" and calls this command with custid as the parameter each time it refreshes. For oracle it uses rowid instead of primary key unless we configure ado differently. This has its own side effects.\n\nThis should give you some idea about the limiations of Resync command.\n\nSo we can use Resync, keeping in mind that it can fail at times and for some recordsets. Solution is to programitically assign right values to the two properties oRs:Properties(\"Root Table\") and oRs:Properties(\"Resync Command\")",
"time": "16:37",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "RecordSet object has Properities collection. \noRs:Properties(\"Resync Command\"):Value is what ADO internally uses to retrieve the values of the current row. This value can be set by our program but i am not able to change this property through xharbour. (works in vbasic) \n\nADO has to know the primary key or some unique id of the row to internally construct this command. For example a table has two columns \"custid\", \"custname\" with custid as primary key and if ado can know this, it will internelly construct the resync command as \"select * from customers where custid = ?\" and calls this command with custid as the parameter each time it refreshes. For oracle it uses rowid instead of primary key unless we configure ado differently. This has its own side effects. \n\nOk .. let me see here .. I have a table called CERT and a unique ID assigned to each row called EID\n\nProgramatically, how would you assign the above properties for the Resync method to work ??\n\ncEid := oRs:Fields(\"eid\"):Value\noRs:Properties(\"Resync Command\"):Value := cEID\noRs:ReSync( 1, 2 )\n\nRick Lipkin",
"time": "16:50",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "It should be like this.\n\n[code:xfhf3qbh]\noRs:Properties(\"Resync Command\"):Value := \"SELECT * FROM CERT WHERE EID = ?\"\n[/code:xfhf3qbh]\n\nBut as I said earlier, assignment is not working through xHarbour.\n\nPlease read this topc on msn\n\n[url:xfhf3qbh]http://msdn2.microsoft.com/en-us/library/ms676094.aspx[/url:xfhf3qbh]\n\nHowever in most cases resync is working for me usually with some exceptions.",
"time": "17:13",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I just checked on MSSQL server with a two column table. Resync of current row is working fine, after a different usr from a different workstation modifed the data through other frontend. No need to touch properties. ( do not modify the uniquely indexed column values). Please try again with some other simple table with atleast one unique index.",
"time": "17:47",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Please try again with some other simple table with atleast one unique index\n\nPer your previous post .. as you suspected .. asigning the resync properties did not work ..\n\nInteresting .. I do not have any indexes .. none at all .. perhaps this is the reason it is failing.\n\nRick Lipkin",
"time": "18:58",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "SUCCESS!!!!!!!!!!!!!!\n\nFor the oRs:ReSync( 1,2 ) option to work .. you MUST have a PRIMARY KEY set and NOT NULL checked. No other changes to the syntax need to be made.\n\nReSync() works perfectically and will update the visability of a changed record to a local cached recordset !\n\nThank you !!\n\nRick Lipkin",
"time": "20:59",
"topic": "ADO update visability between workstations",
"username": "Rick Lipkin"
}
] |
ADO update visability between workstations
|
[
{
"date": "2007-06-26",
"forum": "FiveWin for Harbour/xHarbour",
"text": "In future, if you get any ADO feature not working, put a standard routine to show the last ADO Error after CATCH. ADO Connection object contains an Errors collection. Last item of the Errors collection is the recent Error Object. Error object has these properties: Description, NativeError, Number, Source, SQL State, HelpContext, HelpFile.\n\nIf we write a generic routine to show ADO last error and put it after each CATCH statement, we know what to do without losing much time.",
"time": "05:27",
"topic": "ADO update visability between workstations",
"username": "nageswaragunupudi"
}
] |
ADO update visability between workstations
|
[
{
"date": "2010-06-05",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hi All . \n\nI use use ADO to access MySql DB. I try modify a row using :\n[code=fw:18psgrge]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"> </div>[/code:18psgrge]\n oRecordSet := TOleAuto():New( \"ADODB.Recordset\" )\n oRecordSet:CursorType := adOpenDynamic \n oRecordSet:CursorLocation := adUseClient\n oRecordSet:LockType := adLockOptimistic\n\n TRY\n oRecordSet:Open( \"SELECT filename FROM testi WHERE iddoc = 217 \" , oConnection )\n CATCH oErr\n MsgAlert( \"Error to Open testi\" )\n END TRY\n oRecordset:Fields(\"filename\" ):Value = \"new value\"\n oRecordset:update()\n[/code]\n\nbut I get : \n[i:18psgrge]WINOLE/1007 Argument error: UPDATE[/i:18psgrge]\n\nany idea ? \n\nBest regards. \n\nWzaf",
"time": "16:17",
"topic": "ADO update() error",
"username": "wzaf"
}
] |
ADO update() error
|
[
{
"date": "2010-06-05",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Perhaps in the select statement filename is a reserved word .. you might try :\n\noRecordSet:Open( \"SELECT [filename] FROM testi WHERE iddoc = 217 \" , oConnection \n\nYou can test the reserved by \"select * from ......\" then see if you update() fails .. if it does not fail ... filename may need to be in brackets ..\n\nJust a quick guess ..\n\nRick Lipkin",
"time": "16:47",
"topic": "ADO update() error",
"username": "Rick Lipkin"
}
] |
ADO update() error
|
[
{
"date": "2010-06-06",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Tank you Rick ,\nBut I tried with different fields of the table, and I get always the same error: \nIf I modify the field value, I get error in update method. \nIn I modify nothing, the update() succeed !. \n\nBest regards\n\nWzaf",
"time": "20:53",
"topic": "ADO update() error",
"username": "wzaf"
}
] |
ADO update() error
|
[
{
"date": "2010-06-06",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Maybe you don't have rights to write to the table?",
"time": "21:27",
"topic": "ADO update() error",
"username": "James Bott"
}
] |
ADO update() error
|
[
{
"date": "2010-06-06",
"forum": "FiveWin for Harbour/xHarbour",
"text": "No, James, I have all rights for all DB .\n\nTank you\nWzaf",
"time": "21:47",
"topic": "ADO update() error",
"username": "wzaf"
}
] |
ADO update() error
|
[
{
"date": "2010-06-06",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Is the recordset empty?\n\nJames",
"time": "22:08",
"topic": "ADO update() error",
"username": "James Bott"
}
] |
ADO update() error
|
[
{
"date": "2010-06-06",
"forum": "FiveWin for Harbour/xHarbour",
"text": "No, it is filled with the result of Query: \"SELECT filename FROM testi....\" \n\nWzaf",
"time": "22:20",
"topic": "ADO update() error",
"username": "wzaf"
}
] |
ADO update() error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.