Board index » delphi » Assistance Please: Delphi DB Insert Using TQuery: Oracle8i backend.

Assistance Please: Delphi DB Insert Using TQuery: Oracle8i backend.

HELP!!!
I can't get this insert statement to work(I get my err msg : Unable to open
database). My select statements work and my direct inserts(using ''sara'' for
myName value instead of a parameter) work and I also set the sql statement to
'Delete from cstable' and it worked but I can't get this insert to work. The
dbase backend is Oracle8i and the Name field is a varchar(50): it was a
varchar2(50) but I changed it to see if it would work. I need new EYES(lol).
Any help WOULD BE greatly appreciated! Also, how can I know which conversion
function on the parameters to use betwn Oracle and Delphi...for example I have
datetimepicker objects in my form that I need to send the values to an Oracle
date field: Any code samples? Thanks ever so much!

-------------------------------------------------------------------------------------
try
           DB.AliasName := 'DASAP-MSOFT';
           DB.DatabaseName := 'myMS_ODBC_ORA_DB';
           DB.LoginPrompt := False;
           DB.Params.Values['user name'] := 'audituser';
           DB.Params.Values['password'] := 'selection';

           Q.DatabaseName :=    DB.DatabaseName;

           DS.DataSet := MainFormAddNewPageQuery_Initialize;

           Q.SQL.Clear;

          Q.SQL.Add('INSERT INTO CstabLE(NAME) VALUES(:myName)');

           Q.ParamByName('myName').AsString := 'TestName';

           ShowMessage('The param myName value is: ' + Q.Params[0].Value);

           Q.ExecSQL;

except;
          ShowMessage('Unable to open database.');
end;

------------------------------------------------------------------------------------

--
Posted from  [204.89.69.25]
via Mailgate.ORG Server - http://www.Mailgate.ORG

 

Re:Assistance Please: Delphi DB Insert Using TQuery: Oracle8i backend.


Quote
> except;
>           ShowMessage('Unable to open database.');
> end;

This code hide error message get by bde from oracle db!
If you eclude try .. except, you can see REAL error message.
On it you can work!

Bye

AS

--
Posted from  [212.17.220.41]
via Mailgate.ORG Server - http://www.Mailgate.ORG

Other Threads