Solved

Date in Power Builder 7 and Access

Posted on 2001-08-01
7
1,331 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now