Solved

Date in Power Builder 7 and Access

Posted on 2001-08-01
7
1,325 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

762 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

21 Experts available now in Live!

Get 1:1 Help Now