Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Date in Power Builder 7 and Access

Posted on 2001-08-01
7
Medium Priority
?
1,373 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Accepted Solution

by:
Bhatti earned 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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. …
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 perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

972 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