ya tenia un buen que no me conectaba ó seguía con algún proyecto, bueno gracias por las respuestas y si yo deseo solo limitar la escritura a 10 filas, les explico mas claro, con un Button creo mi .db
cupolimit = Input.GetText("CUPO")
sDatabaseFile = _SourceFolder .. "\\AutoPlay\\Docs\\".. cupolimit ..".db";
db = SQLite.Open(sDatabaseFile);
nLastError = Application.GetLastError();
if nLastError ~= SQLite.OK then
Dialog.Message("Error al abrir archivo", SQLite.GetLastErrorString());
end
SQLite.Query(db,"CREATE TABLE recargas(RecordID integer primary key, NOMBRE text, FECHA text)");
Page.Jump("CUPOS")
-----------------------------------------------------------------------
On Show
Input.SetText("CUPO", strpath1);
tabla = Label.GetText("CUPO")
nMaxFiles = 10;
q = "SELECT * FROM" .. tabla ..";
tbConsulta = SQLite.QueryToTable(db, q);
if (tbConsulta.Rows > nMax) then
bPermitido = false;
else
bPermitido = true;
end
------------------------------------------------------------------
En la Pagina CUPOS tengo las Input para anotar Nombre y Fecha, al momento compare, si ejemplo ya 10 filas que ya fueron ocupadas ya no acceder mas datos y negar guardado.
Button para guardado ó bloqueador de registros mayores a 10
function Escape (sSourceString)
sSourceString = String.Replace(sSourceString, "'", "''", false);
return sSourceString;
end
sNUMERO = Input.GetText("InputNUMERO");
sFOLIO = Input.GetText("InputFOLIO");
sSALDO = ComboBox.GetText("ComboBox_SALDO");
sVENDEDOR = Input.GetText("ASISTENTE");
if bNewRecord then
SQLite.Query(db, "insert into recargas values(NULL, '"..sNOMBRE.."', '"..sFECHA.."')");
nLastError = Application.GetLastError();
if nLastError ~= SQLite.OK then
Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
end
else
SQLite.Query(db,"insert or replace into recargas values('".. nRecordID .."', '".. sNOMBRE.."', '"..sFECHA.."')");
nLastError = Application.GetLastError();
if nLastError ~= SQLite.OK then
Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
end
end
if (bPermitido) then
--Ingresas datos
else
Dialog.Message("", "No hay mas registros");
end
SQLite.Close(db);
Ahora he tratado de acomodar los datos que me dieron, solo que en algunos lados cambian por el Valor de nombre de mi nombre que es indefinido y la cual para crear la base de datos la creo con un Button. cual seria el orden. para acomodarlo?.
Se que ando mal pero haber si me pueden solo corregir, no se si me explique lo que pretendo?