Solved

Date in Power Builder 7 and Access

Posted on 2001-08-01
7
1,344 Views
Last Modified: 2013-12-26
I have a database in Microsoft Access 97. The definition field is DateTime  and in the Script Boton, define a DateTime variable type and write a Sql Statement (Insert), puting the follow statement :

************************ Event Click
DateTime  ldtm_hoy

ldtm_hoy = DateTime ( Today (), Now() )

INSERT INTO cuenta_corriente
            ( fecha_inicio )
     VALUES ( :ldtm_hoy ) ;

***************

And when saved my form the error occur "C0038:SqlState = 3700 [ODBC Microsoft Access Driver ] Reserved error(|); there is no message for this error."

I don't know, what is this, what i do ? plese respond me
I'm sorry, my inglish is very poor.  my mail is fstuven@infoauto.gov.ar
0
Comment
Question by:pepe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:kokan
ID: 6343487
Intead of using a datatime field, you can use a string value to store the date time value and insert into the table.  It should work.
0
 
LVL 4

Expert Comment

by:Bhatti
ID: 6348268
Check your ODBC connection to Access. If it is OK then

Please check the format of the datetime in your table and the format of the datetime you are inserting.

Let me know please for further actions if necessary.
0
 

Author Comment

by:pepe
ID: 6365552
I take the kokan@devx propos becouse i'm check the ODBC and check the format and insert format in the table too.

If somebody know other way, please let me know.

THANK.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
Bhatti earned 100 total points
ID: 6367442
If ODBC connection and the formats of the datetime in your table and variable you are inserting are same, then please try this.

Sometimes you need to add the name of the table with the name of the column in the INSERT statement.

INSERT INTO cuenta_corriente
                                ( cuenta_corriente.fecha_inicio )
                         VALUES ( :ldtm_hoy ) ;

May this will help you.
0
 

Expert Comment

by:darrelljude
ID: 6386466
//See whether the below code will work by creating
//datastore and let the powerbuilder handle the insert
//instead of a straight insert SQL - darrell

string ls_select,ls_err
long ll_row
DateTime  ldtm_hoy
datastore  ds_cuenta_corriente

ls_select = 'select fecha_inicio from cuenta_corriente'

ds_cuenta_corriente = create datastore

ds_cuenta_corriente.create(syntaxfromsql(sqlca, ls_select,' ', ls_err), ls_err)

ds_cuenta_corriente.settransobject(sqlca)
ll_row = ds_cuenta_corriente.insertrow(0)


ldtm_hoy = DateTime ( Today (), Now() )

ds_cuenta_corriente.setitem(ll_row,'fecha_inicio',ldtm_hoy)

ds_cuenta_corriente.update()
commit;

destroy ds_cuenta_corriente
0
 

Expert Comment

by:ksalman
ID: 6386861
I created a table test1 with two columns (field1 datetime, field2 long) in Access.

Then I wrote the following code in powerbuilder
and it inserted records into the table properly.

DateTime  ldtm_hoy

ldtm_hoy = DateTime ( Today (), Now() )

INSERT INTO test1 ( "field1", "field2" )
    VALUES ( :ldtm_hoy, 1 ) ;

      IF SQLCA.SQLCODE <> 0 THEN
          MessageBox("Error", SQLCA.SQLErrText)
      END IF
commit;


Are you specifying all the columns required for the insert statement?

You need to specify all the required columns in that table
in your insert statement.
0
 

Expert Comment

by:SpideyMod
ID: 8297059
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Notepad++ search not working 6 1,722
eclipse ide not starting 16 88
Custom ckeditor using builder 10 133
PHPStorm, PHPUnit not found in include path 2 642
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question