Remarks In order to work, the proper ODBC drivers must have been installed and configured in the ODBC Manager in the Control Panel.
Example
static void Job21(Args _args)
{
LoginProperty LP = new LoginProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
;
LP.setDSN("MSAccess2000");
try {
myConnection = new OdbcConnection(LP);
}
catch {
info("Check username/password.");
return;
}
myStatement = myConnection.createStatement();
myResult = myStatement.executeQuery("SELECT Title FROM Employees");
while (myResult.next())
print myResult.getString(1);
}
Good luck Ronnie,
Best regards,
Liviu
Ronnie Lu <[EMAIL PROTECTED]> wrote:
Dear Liviu,
Thanks for your example.
Do you know how to catch the ODBC connection error in Axapta? Such as wrong username or password. It seems that the code in catch section will not be executed.
Any help would be appreciated.
Thanks
Ronnie
LIVIU STOICA <[EMAIL PROTECTED]> wrote:
Hi,
An OciConnection establishes a database connection using Oci (Oracle Call Interface).
Within the context of an OciConnection, SQL statements are executed and results are returned
Example{ loginProperty LoginProperty = new LoginProperty();
ociConnection ociConnection;
statement stmt;
resultSet res;
;
LoginProperty.setServer("ORACLETESTSRV");
LoginProperty.setDatabase("AXDB");
LoginProperty.setUsername("TEST");
LoginProperty.setPassword("TEST_PWD");
try
{
ociConnection = new ociConnection(LoginProperty);
}
catch
{
print "Unable to establish connection with database";
return;
}
stmt = ociConnection.createStatement();
res = stmt.executeQuery("SELECT empName FROM emp");
while (res.next())
print res.getString(1);
pause;
}
Best regards,
Liviu
daniellim_yh <[EMAIL PROTECTED]> wrote:
hi there,
anyone have idea how to call an oracle 9's stored procedure? from
connection setup until the calling syntax?thx in advance.
daniel
SPONSORED LINKS
Computer part Programming languages Microsoft axapta Support exchange
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "development-axapta" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.
[Non-text portions of this message have been removed]
SPONSORED LINKS
Computer part Programming languages Microsoft axapta Support exchange
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "development-axapta" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
[Non-text portions of this message have been removed]
SPONSORED LINKS
Computer part Programming languages Microsoft axapta Support exchange
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "development-axapta" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
[Non-text portions of this message have been removed]
SPONSORED LINKS
| Computer part | Programming languages | Microsoft axapta |
| Support exchange |
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

