Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Associated statement is not prepared
Message
De
07/12/2012 15:01:23
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01559065
Message ID:
01559080
Vues:
52
>>This error message is about as useless as a boar hog on ice skates as I can't find anything that explains what this means.
>>
>>Has anyone run into this before? How did you figure it out?
>>
>>
>>Here's what happened.
>>Modified a stored proc, saved it and executed it - executed with no errors.
>>
>>Try to call it from VFP and I get this error.
>>
>>AError returns
>>1) 1526
>>2) "Connectivity error.[Microsoft][ODBC SQL Server Driver]Associated statement is not prepared"
>>3) [Microsoft][ODBC SQL Server Driver]Associated statement is not prepared"
>>4) "S1007"
>>5) 0
>>6) 1
>>7) .NULL.
>>
>>SP is as follows
>>
>>USE [TestingExpECL]
>>GO
>>/****** Object:  StoredProcedure [dbo].[UpdateMaster]    Script Date: 12/07/2012 10:55:39 ******/
>>SET ANSI_NULLS ON
>>GO
>>SET QUOTED_IDENTIFIER ON
>>GO
>>-- =============================================
>>-- Author:		Dorrie Beaird
>>-- Create date: November 2012
>>-- Description:	Updates Experimental Master Record
>>-- =============================================
>>ALTER PROCEDURE [dbo].[UpdateMaster]
>>  @MasterID int,
>>  @Cat		nchar(2),
>>  @DL		nchar(1),
>>  @ALC		nchar(3),
>>  @Key1		nvarchar(max),
>>  @key2		nvarchar(max),
>>  @CR		nchar(1),
>>  @Script	                nvarchar(max),
>>  @Stem		nvarchar(max),
>>  @RA		nvarchar(max),
>>  @RB		nvarchar(max),
>>  @RC		nvarchar(max),
>>  @RD		nvarchar(max),
>>  @ST		int,
>>  @EN		nvarchar(max),
>>  @IS		bit,
>>  @RevB		nchar(3),
>>  @RevD		date,
>>  @CO		bit
>>  	
>>AS
>>BEGIN
>>  declare @iError int, @iRowCnt int
>>  SET NOCOUNT ON;
>>  begin transaction
>>  update [TestingExpECL].[dbo].[ExpMaster] set
>>    [Category] = @Cat,[DiffLet] = @DL,[alc] = @ALC,[Keyword] = @Key1,
>>    [Keyword2] = @Key2,[CorrectResp] = @CR,[Script] = @Script,[stem] = @Stem,
>>    [RespA] = @RA,[RespB] = @RB,[RespC] = @RC,[RespD] = @RD,[ScriptTime] = @ST,
>>    [EnterNotes] = @EN,[IncSave] = @IS,[ReviewedBy] = @RevB,[ReviewDate] = @RevD,[Completd] = @CO
>>    where XPID = @MasterID
>>  if @iError > 0
>>    begin
>>      raiserror('Error on Master Update -  %d',16,1, @iError) 
>>      rollback transaction
>>    end
>>  commit transaction
>>END
>>
>>
>>My parameter statements are as follows:
>>
>>  m.param1 = "?EditRec.XpID,?EditRec.Category, ?EditRec.DiffLet, ?EditRec.ALC, ?EditRec.Keyword, ?EditRec.Keyword2, " + ;
>>       "?EditRec.CorrectResp, " 
>>  m.param2 = "?STRTRAN(EditRec.Script, CHR(13), '/n'), ?STRTRAN(EditRec.Stem, CHR(13), '/n'), ?EditRec.RespA, " + 
>>       "?EditRec.RespB, ?EditRec.RespC, ?EditRec.RespD," 
>>  m.param3 = "?EditRec.ScriptTime, ?STRTRAN(EditRec.EnterNotes, CHR(13), '/n'),  ?IIF(EditRec.IncSave, 'True','False'), ?null," 
>>  m.param4 = " ?null,  ?'False'"
>>
>
>How do you call this SP from VFP?
>Also, I don't see where you set values for @iError and @iRowCnt.
>And DO NOT change CHR(13) to [\n] abd .t./.f. to TRUE/FALSE that is a SPT job to do.

The full call is
msql1 = "Execute TextingExpECL..UpdateMaster "
m.params1 =
...
m.params4 =
ms1 = sqlexec(Thisform.r_conn, msql1 + m.params1 + m.params2 + m.params3 + m.params4)

@iError is set in this code
>> if @iError > 0
>> begin
>> raiserror('Error on Master Update - %d',16,1, @iError)
>> rollback transaction
>> end

Why not change the chr(13)? The issue is that SQL eats the chr(13) and I need the line breaks to be as entered, so I change it 1) to something that I wouldn't use usually, and 2) something that HTML would understand, since certain records get exported for HTML display.

As far as the 'True' vs .t., SQL, at least our set up, doesn't like/understand .t. being passed in.
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform