Forms y Access

rarchila
30 de Julio del 2003
Deseo saber si puedo ejecutar SELECT, INSERT, UPDATE y DELETE desde desde FORMS 6i sovbre tablas de Access

nerea
30 de Julio del 2003
Hola:
Necesitas instalarte el componente "Open Cliente Adapter" que viene en el CD del Developer.
Esto de instalará una librería oca.pll que deberás atachar en tu form.
Eso te permitirá acceder por ODBC a otras bases de datos. Por ejemplo:

FUNCTION get_access RETURN pls_integer IS
connection pls_integer;
cursor1 pls_integer;
stmt varchar2(1000);
n pls_integer;
BEGIN
stmt := 'select count(*) from emp';
connection := oca.dbconnect('scott/tiger@odbc:msa');

message(to_char(connection));
cursor1 := oca.execute(connection,stmt);

loop
begin
oca.fetch_row(connection,cursor1);
oca.coldata(connection,cursor1,1,n);
message(to_char(n)||' record(s)');

exception
when no_data_found then
message('NO MORE ROWS');
exit;
end;
end loop;

oca.close(connection,cursor1);
oca.disconnect(connection);
return n;

exception
when oca.connection_error
then message('OCA-Connection error');
when oca.cursor_error
then message('OCA-Cursor error'); when others
then message('Other Error');
end;