Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Thursday, March 22, 2012

Error 8152

I'm trying to add a record to a table and am getting Error 8152:
String or binary data would be truncated.
Here is my statement written with VBA in an Access project.
Both datatypes are nvarchar
Private Sub cmdCreateJob_Click()
Dim strJcn As String
Dim strParcTag As String
Dim strSql As String
strJcn = 999999
strParcTag = Me.cboEquipID.Column(0)
strSql = "INSERT INTO ESR (ESR_JCN,ESR_PARCTAG)" _
& " VALUES ('strJcn','strParcTag')"
DoCmd.RunSQL strSql
End Sub
Can anyone see what I'm doing wrong? Thanks.Can you post your DDL for table ESR?
Perayu
"AkAlan" <AkAlan@.discussions.microsoft.com> wrote in message
news:E21FB5F9-31A7-4FA4-89AD-49F37A3CA0E7@.microsoft.com...
> I'm trying to add a record to a table and am getting Error 8152:
> String or binary data would be truncated.
> Here is my statement written with VBA in an Access project.
> Both datatypes are nvarchar
> Private Sub cmdCreateJob_Click()
> Dim strJcn As String
> Dim strParcTag As String
> Dim strSql As String
> strJcn = 999999
> strParcTag = Me.cboEquipID.Column(0)
> strSql = "INSERT INTO ESR (ESR_JCN,ESR_PARCTAG)" _
> & " VALUES ('strJcn','strParcTag')"
> DoCmd.RunSQL strSql
> End Sub
> Can anyone see what I'm doing wrong? Thanks.
>
>
>|||Check the ESR_JCN column length and strJcn string length
and ESR_PARCTAG column length and strParcTag string length
The data length must be longer than column length
Thanks & Rate the Postings.
-Ravi-
"AkAlan" wrote:

> I'm trying to add a record to a table and am getting Error 8152:
> String or binary data would be truncated.
> Here is my statement written with VBA in an Access project.
> Both datatypes are nvarchar
> Private Sub cmdCreateJob_Click()
> Dim strJcn As String
> Dim strParcTag As String
> Dim strSql As String
> strJcn = 999999
> strParcTag = Me.cboEquipID.Column(0)
> strSql = "INSERT INTO ESR (ESR_JCN,ESR_PARCTAG)" _
> & " VALUES ('strJcn','strParcTag')"
> DoCmd.RunSQL strSql
> End Sub
> Can anyone see what I'm doing wrong? Thanks.
>
>
>|||It looks like this VB(?) code is wrong: " VALUES ('strJcn','strParcTag')".
You are inserting 'strJcn', not the value of strJcn, to ESR_JCN column. You
need to try something like " VALUES ('" + integerToString(strJcn) + "', '"
+ strParcTag+ "')". But I am not sure what the syntact is for concatinate
the single quots in VB.
Perayu
"AkAlan" <AkAlan@.discussions.microsoft.com> wrote in message
news:E21FB5F9-31A7-4FA4-89AD-49F37A3CA0E7@.microsoft.com...
> I'm trying to add a record to a table and am getting Error 8152:
> String or binary data would be truncated.
> Here is my statement written with VBA in an Access project.
> Both datatypes are nvarchar
> Private Sub cmdCreateJob_Click()
> Dim strJcn As String
> Dim strParcTag As String
> Dim strSql As String
> strJcn = 999999
> strParcTag = Me.cboEquipID.Column(0)
> strSql = "INSERT INTO ESR (ESR_JCN,ESR_PARCTAG)" _
> & " VALUES ('strJcn','strParcTag')"
> DoCmd.RunSQL strSql
> End Sub
> Can anyone see what I'm doing wrong? Thanks.
>
>
>|||Ok I got everything to work up until I add the datOpenDate field. It only
puts 12:00 AM in the record when I put 1 mar 06 in the form. Here is what I
have so far:
I have tried formatting the datefield but no go. Thanks,
strJcn = "'" & NextJCN() & "'"
strParcTag = "'" & Me.cboEquipID.Column(0) & "'"
strPerfWc = "'" & Me.cboPWC & "'"
strRptby = "'" & Me.cboReportedBy.Column(0) & "'"
strDisc = "'" & Me.txtDisc & "'"
datOpenDate = “’” & Me.txtOpenDate & “’”
strSQL = "INSERT INTO ESR
(ESR_JCN,ESR_PARCTAG,ESR_DISC,ESR_RPTBY,
ESR_OPEN_DATE)" _
& " VALUES (" & strJcn & "," & strParcTag & "," & strDisc & "" _
& "," & strRptby & ", " & datOpenDate & " )"
DoCmd.RunSQL strSQL
"Perayu" wrote:

> It looks like this VB(?) code is wrong: " VALUES ('strJcn','strParcTag')"
.
> You are inserting 'strJcn', not the value of strJcn, to ESR_JCN column. Yo
u
> need to try something like " VALUES ('" + integerToString(strJcn) + "', '
"
> + strParcTag+ "')". But I am not sure what the syntact is for concatinate
> the single quots in VB.
> Perayu
> "AkAlan" <AkAlan@.discussions.microsoft.com> wrote in message
> news:E21FB5F9-31A7-4FA4-89AD-49F37A3CA0E7@.microsoft.com...
>
>|||It looks like you have typo here: datOpenDate = "'" & Me.txtOpenDate & "'".
"'" should be "'".
Perayu
"AkAlan" <AkAlan@.discussions.microsoft.com> wrote in message
news:2ABA6908-E32F-4C09-9BC0-BCF089F15C0F@.microsoft.com...
> Ok I got everything to work up until I add the datOpenDate field. It only
> puts 12:00 AM in the record when I put 1 mar 06 in the form. Here is what
> I
> have so far:
> I have tried formatting the datefield but no go. Thanks,
> strJcn = "'" & NextJCN() & "'"
> strParcTag = "'" & Me.cboEquipID.Column(0) & "'"
> strPerfWc = "'" & Me.cboPWC & "'"
> strRptby = "'" & Me.cboReportedBy.Column(0) & "'"
> strDisc = "'" & Me.txtDisc & "'"
> datOpenDate = "'" & Me.txtOpenDate & "'"
> strSQL = "INSERT INTO ESR
> (ESR_JCN,ESR_PARCTAG,ESR_DISC,ESR_RPTBY,
ESR_OPEN_DATE)" _
> & " VALUES (" & strJcn & "," & strParcTag & "," & strDisc & "" _
> & "," & strRptby & ", " & datOpenDate & " )"
> DoCmd.RunSQL strSQL
>
> "Perayu" wrote:
>

Sunday, March 11, 2012

Error 534 trying to run report

I have written a report in the Crystal IDE that runs fine. It is using OLE DB to a SQL Server database. When I then try to run that report at runtime, outside of Crystal, I get an error 534 returned. I am using the CPRE32 API and I am using version 8.5.Try looking up the error number or error description on www.google.com or on Crystal's Website: http://support.businessobjects.com/search/advsearch.asp|||I have done both of those. There is quite a bit of good information out there. But none of it so far has helped me. I recently tried switching from using P2SOLEDB.DLL to P2SSQL.DLL just to see what would happen, but I still get 534...|||Have you verified database?I usually get error 534 when database verification is needed.|||I will post this info here in hopes that it will help others who search for this problem.

The solution to my 534 problem was to use the PESetNthTableLocation API call. I had to call Crystal support to get this information.

The problem was caused by my changing database names at runtime.

I wrote all my reports to report on database "A", so to Crystal, the database "location" was "A.dbo.tablename". Then, at runtime, if the user of my application was running the reports on database "B", I was calling PESetNthTableLogOnInfo and setting the database to "B". However, according to Crystal support, sometimes that is not enough. Sometimes you also have to change the database location. So, once I called PESetNthTableLocation (setting it to "B.dbo.tablename") in addition to PESetNthTableLogOnInfo, it worked fine...

Sunday, February 26, 2012

Error 3621

For some reason I'm getting the following error on my MS2000 MSSQl
server. THe message is being written into my logs on the server.
MSSQL Error Msg 3621 The statement has been terminated
THis is then followed by the information message
Connected to DB
THis continues in a over and over again. My DB was working
fine and I could use the query analyzer, now however I cannot
query anything in the DB.
Any help would be great. I really dont want to reinstall this
as a solution.
TIA
dogdog
This message is usually preceded by another message indicating the cause the
error. Are these messages in the SQL Server error log or in a log generated
by your application?
Hope this helps.
Dan Guzman
SQL Server MVP
<dogdog@.noemail.com> wrote in message
news:pan.2006.03.25.15.15.20.194339@.noemail.com...
> For some reason I'm getting the following error on my MS2000 MSSQl
> server. THe message is being written into my logs on the server.
> MSSQL Error Msg 3621 The statement has been terminated
> THis is then followed by the information message
> Connected to DB
> THis continues in a over and over again. My DB was working
> fine and I could use the query analyzer, now however I cannot
> query anything in the DB.
> Any help would be great. I really dont want to reinstall this
> as a solution.
> TIA
> dogdog
|||On Sat, 25 Mar 2006 09:32:12 +0000, Dan Guzman wrote:

> This message is usually preceded by another message indicating the cause the
> error. Are these messages in the SQL Server error log or in a log generated
> by your application?
The next message after the error 3621 is Statement has been terminated
and is then followed by an information message
stating "connected to db" This sequence just keeps going and going
over and over.
Hope that helps. Because it means absolutely nothing to me.
tks
dogdog
|||So these messages are in a log generated by your application? In that case,
it appears your application is reporting only the 3621 warning message and
not the preceding error that caused the statement to be terminated.
For example, below are the messages that are displayed by Query Analyzer
when I get a primary key violation:
Server: Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint 'PK_Table1'. Cannot insert duplicate key
in object 'Table1'.
The statement has been terminated.
If you have no control over the application logging behavior, I suggest you
run a Profiler trace to capture error events. This should help you identify
the problem SQL statements.
Hope this helps.
Dan Guzman
SQL Server MVP
<dogdog@.noemail.com> wrote in message
news:pan.2006.03.25.20.57.13.800017@.noemail.com...
> On Sat, 25 Mar 2006 09:32:12 +0000, Dan Guzman wrote:
>
> The next message after the error 3621 is Statement has been terminated
> and is then followed by an information message
> stating "connected to db" This sequence just keeps going and going
> over and over.
> Hope that helps. Because it means absolutely nothing to me.
> tks
> dogdog
|||On Sun, 26 Mar 2006 06:27:38 +0000, Dan Guzman wrote:
First off thanks for taking your time on this and explaining things to
me a novice with mssql.

> So these messages are in a log generated by your application? In that case,
> it appears your application is reporting only the 3621 warning message and
> not the preceding error that caused the statement to be terminated.
>
Yes they are being written to the system log by the mssql server. I
guess that was the best idea for this setup rather than having numerous
logs.

> For example, below are the messages that are displayed by Query Analyzer
> when I get a primary key violation:
> Server: Msg 2627, Level 14, State 1, Line 1
> Violation of PRIMARY KEY constraint 'PK_Table1'. Cannot insert duplicate key
> in object 'Table1'.
> The statement has been terminated.
> If you have no control over the application logging behavior, I suggest you
> run a Profiler trace to capture error events. This should help you identify
> the problem SQL statements.
It seems as if the last query ran is "stuck" for lack of a better
understanding and just keeps querying. So it runs (without user
interaction for some reason) then reports the Error 3621 Statement
has been terminated. Then waits and reconnects to the server and
does it again. Seems crazy but I didnt make this stuff and it
makes it really hard to figure out when you inherit something like
this. Unfortunately there are no other logs to help in troubleshooting
and I want to avoid reinstalling the entire database. Luckily it
just came online and we just started testing it (i.e. sending
queries on test data) so if it does come down to reloading there
will be nothing lost. I just want to avoid that.
Thanks again for your help. If you have any other ideas I'll be glad
to try them out. I'm going to give the Profiler trace idea a shot.
Hopefully it will lead to something.

Error 3621

For some reason I'm getting the following error on my MS2000 MSSQl
server. THe message is being written into my logs on the server.
MSSQL Error Msg 3621 The statement has been terminated
THis is then followed by the information message
Connected to DB
THis continues in a over and over again. My DB was working
fine and I could use the query analyzer, now however I cannot
query anything in the DB.
Any help would be great. I really dont want to reinstall this
as a solution.
TIA
dogdogThis message is usually preceded by another message indicating the cause the
error. Are these messages in the SQL Server error log or in a log generated
by your application?
Hope this helps.
Dan Guzman
SQL Server MVP
<dogdog@.noemail.com> wrote in message
news:pan.2006.03.25.15.15.20.194339@.noemail.com...
> For some reason I'm getting the following error on my MS2000 MSSQl
> server. THe message is being written into my logs on the server.
> MSSQL Error Msg 3621 The statement has been terminated
> THis is then followed by the information message
> Connected to DB
> THis continues in a over and over again. My DB was working
> fine and I could use the query analyzer, now however I cannot
> query anything in the DB.
> Any help would be great. I really dont want to reinstall this
> as a solution.
> TIA
> dogdog|||On Sat, 25 Mar 2006 09:32:12 +0000, Dan Guzman wrote:

> This message is usually preceded by another message indicating the cause t
he
> error. Are these messages in the SQL Server error log or in a log generat
ed
> by your application?
The next message after the error 3621 is Statement has been terminated
and is then followed by an information message
stating "connected to db" This sequence just keeps going and going
over and over.
Hope that helps. Because it means absolutely nothing to me.
tks
dogdog|||So these messages are in a log generated by your application? In that case,
it appears your application is reporting only the 3621 warning message and
not the preceding error that caused the statement to be terminated.
For example, below are the messages that are displayed by Query Analyzer
when I get a primary key violation:
Server: Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint 'PK_Table1'. Cannot insert duplicate key
in object 'Table1'.
The statement has been terminated.
If you have no control over the application logging behavior, I suggest you
run a Profiler trace to capture error events. This should help you identify
the problem SQL statements.
Hope this helps.
Dan Guzman
SQL Server MVP
<dogdog@.noemail.com> wrote in message
news:pan.2006.03.25.20.57.13.800017@.noemail.com...
> On Sat, 25 Mar 2006 09:32:12 +0000, Dan Guzman wrote:
>
> The next message after the error 3621 is Statement has been terminated
> and is then followed by an information message
> stating "connected to db" This sequence just keeps going and going
> over and over.
> Hope that helps. Because it means absolutely nothing to me.
> tks
> dogdog|||On Sun, 26 Mar 2006 06:27:38 +0000, Dan Guzman wrote:
First off thanks for taking your time on this and explaining things to
me a novice with mssql.

> So these messages are in a log generated by your application? In that cas
e,
> it appears your application is reporting only the 3621 warning message and
> not the preceding error that caused the statement to be terminated.
>
Yes they are being written to the system log by the mssql server. I
guess that was the best idea for this setup rather than having numerous
logs.

> For example, below are the messages that are displayed by Query Analyzer
> when I get a primary key violation:
> Server: Msg 2627, Level 14, State 1, Line 1
> Violation of PRIMARY KEY constraint 'PK_Table1'. Cannot insert duplicate k
ey
> in object 'Table1'.
> The statement has been terminated.
> If you have no control over the application logging behavior, I suggest yo
u
> run a Profiler trace to capture error events. This should help you identi
fy
> the problem SQL statements.
It seems as if the last query ran is "stuck" for lack of a better
understanding and just keeps querying. So it runs (without user
interaction for some reason) then reports the Error 3621 Statement
has been terminated. Then waits and reconnects to the server and
does it again. Seems crazy but I didnt make this stuff and it
makes it really hard to figure out when you inherit something like
this. Unfortunately there are no other logs to help in troubleshooting
and I want to avoid reinstalling the entire database. Luckily it
just came online and we just started testing it (i.e. sending
queries on test data) so if it does come down to reloading there
will be nothing lost. I just want to avoid that.
Thanks again for your help. If you have any other ideas I'll be glad
to try them out. I'm going to give the Profiler trace idea a shot.
Hopefully it will lead to something.