Datetime problem w/ PB 6.5.1 and MS SQL Server 7.0

I am trying to convert a PB 6.5.1 Application to a MS SQL Server 7.0 DB 
using ODBC.  I am getting an error message when trying to insert any 
datetime fields into the DB.  The error is:

Error Code: 241,0
Error Description SQLSTATE = 22008
"Syntax error converting datetime from character string"

The value in the datetime field that appears to be passed from the DW is... 
  {ts '2001-05-18 00:00:00.000000'}

Any help on this is greatly appreciated.

Thank you,
Derek
0
Derek_Zwart_
5/21/2001 8:40:32 PM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

8 Replies
937 Views

Similar Articles

[PageSpeed] 18

Based on the value, it appears to be a timestamp rather than a datetime.

Try running a trace on the SQL being sent to the DB. You can do this by
setting SQLCA.DBMS = 'trace MSS'. When you connect to the database, a
message is displayed specifying the location and name of the log file.

What was the old database you were using ? Some databases treat timestamps
basically as datetime columns, whereas SQL Server does not.

HTH

Sanjiv.


<Derek_Zwart_{NWPDJZ1@wis-pak.com}> wrote in message
news:482F7D341509D6E70071931E85256A53.0071933985256A53@webforums...
> I am trying to convert a PB 6.5.1 Application to a MS SQL Server 7.0 DB
> using ODBC.  I am getting an error message when trying to insert any
> datetime fields into the DB.  The error is:
>
> Error Code: 241,0
> Error Description SQLSTATE = 22008
> "Syntax error converting datetime from character string"
>
> The value in the datetime field that appears to be passed from the DW
is...
>   {ts '2001-05-18 00:00:00.000000'}
>
> Any help on this is greatly appreciated.
>
> Thank you,
> Derek


0
Sanjiv
5/22/2001 7:39:40 AM
I don't know why the DW is generating this string, but if you change the
last part of the time so it looks like the following, SQL Server accepts it.

select {ts '2001-05-18 00:00:00.000'}

Maybe it's a bug in PB, or maybe there's a setting, like in the PBODBC?.ini
(not sure of the file name) that let's you change this. Unfortunately I
haven't worked much with ODBC so I can't help more than this.

Mike


<Derek_Zwart_{NWPDJZ1@wis-pak.com}> wrote in message
news:482F7D341509D6E70071931E85256A53.0071933985256A53@webforums...
> I am trying to convert a PB 6.5.1 Application to a MS SQL Server 7.0 DB
> using ODBC.  I am getting an error message when trying to insert any
> datetime fields into the DB.  The error is:
>
> Error Code: 241,0
> Error Description SQLSTATE = 22008
> "Syntax error converting datetime from character string"
>
> The value in the datetime field that appears to be passed from the DW
is...
>   {ts '2001-05-18 00:00:00.000000'}
>
> Any help on this is greatly appreciated.
>
> Thank you,
> Derek


0
Mike
5/22/2001 4:19:13 PM
I should have been more clear.  I have already converted the data from 
Sybase SQL Anywhere 5.5.03 to MS SQL Sever 7.0.  The problem I am having is 
with powerbuilder 6.5.1.  It is taking the date that I am passing into the 
datawindow and turning it into a timestamp during the update process.  I 
have tried a date, a datetime and even a string(datetime) into the field 
and it always returns the same message.

I have seen similar posts to this problem in the newsgroup, but never a 
resolution.  I converted a small application to PB 7.0 and the problem goes 
away.  I have a feeling there is patch out there for this problem, but I 
cannot find it anywhere.

Thank you for the help,
Derek
0
Derek_Zwart
5/22/2001 5:57:53 PM
I=B4m using PB7 10009 with MSSQL Server 7 (native driver- PBMSS070.DLL)

I have a DW that uses Stored Procedures for Retrieve, Update, Delete and=20
Insert.
Everything works fine while there are no DateTime columns. When there is a =

DateTime column (SmallDateTime in MSSQL 7) the following happens:

Insert:  OK
Update:  Error converting data type varchar to smalldatetime.

The Stored Procedure for update expects a SmallDateTime, and the column is =

a DateTime in PB.=20
Also, the Stored Procedure runs fine from the Query Analyzer.

I have read in the documentation that the native driver supports MS SQL 7.

This is my .INI file:

DBMS=3D'MSS (Msoft) SQL Server 6.0'
ServerName=3DSCRNANTSQL4
Database=3DRENAR
LogId=3DSA
UserId=3DSA
AutoCommit=3D0
DbParm=3DappName=3D'Renar 5.00.0001'


Is this a bug in the native driver? Should I use OLE DB instead?


Any hint or tip would be helpful, since I haven=B4t found an answer in the =

newsgroup.



Adrian Gomez
gomeza@renar.gov.ar
0
Adrian
5/22/2001 9:47:06 PM
I think this has to do with the newer MS MDAC ODBC driver, which does not
accept the 'standard' PB time format.
You can go back to the older version of the driver, or change the PB
default as below.

Mike Kruchten <spamless_mkruchten@fsisolutions.com> wrote in article
<QHRlW3t4AHA.249@forums.sybase.com>...
> I don't know why the DW is generating this string, but if you change the
> last part of the time so it looks like the following, SQL Server accepts
it.
> 
> select {ts '2001-05-18 00:00:00.000'}
> 
> Maybe it's a bug in PB, or maybe there's a setting, like in the
PBODBC?.ini
> (not sure of the file name) that let's you change this. Unfortunately I
> haven't worked much with ODBC so I can't help more than this.
> 
> Mike
> 
> 
> <Derek_Zwart_{NWPDJZ1@wis-pak.com}> wrote in message
> news:482F7D341509D6E70071931E85256A53.0071933985256A53@webforums...
> > I am trying to convert a PB 6.5.1 Application to a MS SQL Server 7.0 DB
> > using ODBC.  I am getting an error message when trying to insert any
> > datetime fields into the DB.  The error is:
> >
> > Error Code: 241,0
> > Error Description SQLSTATE = 22008
> > "Syntax error converting datetime from character string"
> >
> > The value in the datetime field that appears to be passed from the DW
> is...
> >   {ts '2001-05-18 00:00:00.000000'}
> >
> > Any help on this is greatly appreciated.
> >
> > Thank you,
> > Derek
> 
> 
> 
0
KMetz
5/23/2001 3:29:07 PM
Look for these two entries in Pbodb60.ini:


[Microsoft SQL Server]
PBCatalogOwner='dbo'
PBSyntax='MS_SQLSERVER_SYNTAX'
PBDateTime='MSSQLSERVER_DATETIME'
PBFunctions='SYBASE_FUNCTIONS'
PBSpecialDataTypes='SYBASE_SPECIALDATATYPES'
PBObjectIDs='YES'
PBMaxBlobSize='2147483647'
PBMaxTextSize='32767'
PBDWDynamic='NO'
PBPrimaryKeyName='YES'
Block=1
SQLSrvrTSPrefix='0x'
PBUseProcOwner='YES'

AND:


[MSSQLSERVER_DATETIME]
PBDateFmt='\'yyyy-mm-dd\''
PBTimeFmt='\'hh:mm:ss\''
PBDateTimeFmt='\'yyyy-mm-dd hh:mm:ss.fff\''




Derek_Zwart_{NWPDJZ1@wis-pak.com} wrote in article
<482F7D341509D6E70071931E85256A53.0071933985256A53@webforums>...
> I am trying to convert a PB 6.5.1 Application to a MS SQL Server 7.0 DB 
> using ODBC.  I am getting an error message when trying to insert any 
> datetime fields into the DB.  The error is:
> 
> Error Code: 241,0
> Error Description SQLSTATE = 22008
> "Syntax error converting datetime from character string"
> 
> The value in the datetime field that appears to be passed from the DW
is... 
>   {ts '2001-05-18 00:00:00.000000'}
> 
> Any help on this is greatly appreciated.
> 
> Thank you,
> Derek
> 
0
KMetz
5/23/2001 3:59:40 PM
That changed fixed my problem. 

Thank you for the help,
Derek
0
Derek_Zwart
5/23/2001 5:23:28 PM
Derek I have the same problem.

What did you change?

Carlos
ccarcamo@hotmail.com

<Derek_Zwart> escribi� en el mensaje
news:DD4A8D0049CD43B8005F888385256A55.0059EDDB85256A55@webforums...
> That changed fixed my problem.
>
> Thank you for the help,
> Derek


0
Carlos
6/7/2001 12:21:00 AM
Reply:

Similar Artilces:

Problems with PB 6.5.1 and MS SQL Server 7.0
I just started working with MSSS 7.0 and immediately ran into problems. I am not comfortable with the work-arounds, so if anyone can give me a better way to solve these problems, I am listening. 1) I get an ODBC 22008 error from my imbedded sql. The pbtrace.log shows datetime values with a 'yyyy-mm-dd hh:mi:ss.ffffff' format. MS SQL Server can only handle three decimals. So, I changed the PBDateTime setting in the pbodb60.ini file to 'yyyy-mm-dd hh:mi:ss.fff'. Problem circumvented. 2) I get an ODBC 37000 error from my imbedded sql. The pbtrace.log shows datatime bin...

Connection of PB 6.0 to SQL Server 7.0 & Version B/W PB 6.0 and PB 7.0
Can anyone tell me about connecting PB 6.0 to SQL Server 7.0. Please remember we are not planning to upgrade both software. When I was trying to connect PB 6.0 to SQL Server 7.0, error occurred " SQLSTAT 1003". OS=NT 4.0 Server PB=6.0 Enterprise Edition SQL SERVER=7.0 Corporate Edition I also want to know the versions between PB 6.0 to PB 7.0 If your are using the ODBC, which I assume you are, include Disablebind=1 in your DBParm. If your deployment environment is also NT, you will have to turn SQLSPY=1 using PFC services. Autocommit=FALSE and SetTransObject() ra...

Help me about connecting PB 6.0 to SQL Server 7.0 & Versions B/W PB 6.0 and PB 7.0
Can anyone tell me about connecting PB 6.0 to SQL Server 7.0. Please remember we are not planning to upgrade both software. When I was trying to connect PB 6.0 to SQL Server 7.0, error occurred " SQLSTAT 1003". OS=NT 4.0 Server PB=6.0 Enterprise Edition SQL SERVER=7.0 Corporate Edition I also want to know the versions between PB 6.0 to PB 7.0 I don't believe this is going to be possible without at least upgrading to the latest maintenance release of 6.x. On Mon, 23 Aug 1999 00:59:56 -0700, in powersoft.public.powerbuilder.database Abdul Lateef <abdul_lat...

PB 7.0.1
Hi, I just found a solution for correcting the memory leak in 7.0.1, when connecting to MS SQL Server 6.5. May be this is already fixed in the latest releases. I just want to share this in case it's useful to any of you guys. When you connect to the MS SQL Server 6.5 database, be sure to have atleast something in your DBParm attribute of the DBProfile (or SQLCA transaction object at runtime). For example (SQLCA.DBParm = "AppName='IRIS',Host='ZNF9'"). In development time in the DBProfile dialog under "Network" tabpage Enter something i...

Problems with PB 6.5 an MS SQL server 7.0
This is a multi-part message in MIME format. --------------0750141F83AAE38789D43ED0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I use PB 6.5 Eterprise, build 444 and MS SQL Server 7.0 First after installing new *.dll's from EBF 620, i could connect to the database. But I have som problem getting data from the database. From my code: is_navn = Left(Trim(Upper(sle_navn.Text)) + "%", 34) is_fornavn = Left(Trim(Upper(sle_fornavn.Text)) + "%", 34) is_adresse = Left(Trim(Upper(sle_adresse.Text)) + "%", 34) is_postnr = ...

problem when connecting MS SQL Server 7.0 with powerbuilder 6.5
Dear All, I have some problem when connecting MS SQL Server 7.0 with powerbuilder 6.5 The error message is: Database transaction information not availiable. Call SetTrans or SetTransObject function. I have a window with 1 button and 1 datawindow The datawindow inside contain a SQL statement in the click event of the botton, the script is: parent.dw_1.SettransObject(SQLCA) parent.dw_1.retrieve() Can anyone tell me what is the problem? And how to solve it??? Thank You Very Much!!! It seems that the database connection is not available or not successfully connected. ...

Error Connection To MS SQL Server 7.0 From PB 6.5.1
Dear everyone: I have Microsoft Backoffice SmallBusiness 4.5 Chinese Edition. The software suite includes MS SQL Server 7.0. But I can not find Client ODBC Driver For MS SQL Server 7.0 in it. My workstation OS is Windows 98 Chinese Edition. In PB 6.5.1, when I use MSS MS SQL Server 6.x interface, I can connect to the database in the backend server. But when I use SQL Server driver in ODBC, I got error message. The error message is chinese. But I think the english error message maybe like "Program Type Beyond". I want to know how to solve it or how to get ODBC driver for M...

PB 7.0 App Having Login Problems with 6.5 MS SQL Servers
Hello all. I am at a total loss for this problem. Here is my configuration: I have two MS SQL Server's with version 6.5 installed. One server has SP 3 and the other SP 5. My PB app, which is in 7.0, is trying to connect to a seperate database on each server. On server # 1 (sp 3) is a central database and on server # 2 (sp 5) is a "local" database that would be at my remote branches. In my test, it is on my local backbone and I am have the same problem locally as when I come across the WAN. I am getting the following error: [Microsoft][ODBC SQL Server Dr...

Error Connection To MS SQL Server 7.0 From PB 6.5.1
Dear everyone: I have Microsoft Backoffice SmallBusiness 4.5 Chinese Edition. The software suite includes MS SQL Server 7.0. But I can not find Client ODBC Driver For MS SQL Server 7.0 in it. My workstation OS is Windows 98 Chinese Edition. In PB 6.5.1, when I use MSS MS SQL Server 6.x interface, I can connect to the database in the backend server. But when I use SQL Server driver in ODBC, I got error message. The error message is chinese. But I think the english error message maybe like "Program Type Beyond". I want to know how to solve it or how to get ODBC driver for M...

PB 6.5.1 and MS SQL server 7
I have a machine code compiled 6.5.1 application running against MS SQL Server 7, using native drivers (MS SQL server 6.x driver, as no 7 driver is available for PB 6.5). Network protocol used: TCP/IP. Platforms: NT 4.0, NT 2000. I have datawindows retrieving text fields. None of these text fields exceed the 8k limit imposed to retrieving text data with a SELECT statement. Most of them are less than 1K. Here is the problem: Sometimes the text fields are truncated. 99% of the time the result set is fine: I get complete text fields for every row. Now and then, I get truncat...

PowerBuilder 6.5.1; MS SQL Server 7.0; ODBC; Text Column
PowerBuilder 6.5.1 ODBC MS SQL Server 7.0 Text Column I can't seem to insert a String with a length of 66,000 char to a Text Column. I get a to big (999) error I've change this in the pbodb60.ini PBMaxTextSize='2147483647' and I've added DBTextLimit='100000' to my SQLCA.DBParm Any Ideas? Best Regards, Adri�n Galv�n Adrian, Do you have this problem if you use the UpdateBlob statement as well, or just with Insert ? Sanjiv. "Adrian Galvan" <Nospam_agalvan@audisys.com> wrote in message news:40896004$1@forums-1-d...

Porting Ms Sql Server 6.5 Database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

Porting Ms Sql Server 6.5 database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

PB 5 & 6.5 w/ MS SQL 7.0
Can anyone speak to any compatibility problems w/ using PB 5 & 6.5 w/ Microsoft SQL Server 7.0? We are planning on upgrading to SQL 7.0, but have a few apps in both PB6.5 & PB5. Unfortunately, one of these is vendor supplied so we can't upgrade to PB7. I was specifically wondering if there were any problems using native SQL 7.0 drivers w/ the PB6.5 & 5 dlls (that were made before SQL 7.0 was a reality.) Or are there updated drivers for this? any help/experiences offered would be appreciated. thanks!! -- Travis Hettenbach hettenb@kochind.com Me too have th...

Web resources about - Datetime problem w/ PB 6.5.1 and MS SQL Server 7.0 - sybase.powerbuilder.general

Is there a JQuery plugin to convert UTC datetimes to local user timezone?
If I have a tag: &lt;span class="utctime"&gt;2010-01-01 11:30 PM&lt;/span&gt; I would like a jquery script or plug in to convert every utctime ...


Targetprocess 3.7.3: Epic unit for Bug/Story cards, new DateTime functions in Webhook plugin
Webhook plugin supports new DateTime functions AddDays(DateTime date, int days) – Returns a new date with the number of days added. The number ...

Common Pitfalls when working with DateTime’s
In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you ...

Parsing Twitter Date format to .Net DateTime
Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, ...

C Sharp (programming language) - Wikipedia, the free encyclopedia
(pronounced see sharp ) is a multi-paradigm programming language encompassing strong typing , imperative , declarative , functional , generic ...

1753 - Wikipedia, the free encyclopedia
Language: English Afrikaans አማርኛ العربية Aragonés Asturianu Aymar aru Azərbaycanca বাংলা Bân-lâm-gú Basa Banyumasan Беларуская ‪Беларуская (тарашкевіца)‬ ...

Coded Smorgasbord: Schizophrenic Haiku Comments and More
... writes Malcom StandardResponse UnSubscribeNewsletterUserAccount( string opTinGUID,string email, string sellingRegion, string source, DateTime ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Simples Ideias. Por Nando Vieira.
Simples Ideias Siga-me no Twitter Junho/2012 Usando o Vagrant como ambiente de desenvolvimento no Windows http://simplesideias.com.br/usando ...

Resources last updated: 12/11/2015 12:30:44 AM