#35726 - 2003-01-28 12:18 AM
DbGetRecordSet () Question
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Just wondering what the correct format for the connection string to a SQL 2000 server would look like?
THanks so much... also am I understanding correctly that dbgetrecordset() is the correct UDF if I wish to execute a stored procedure that returns records? I want those records back in an array... hope that made sense ; )
Thanks for the help..
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#35728 - 2003-01-29 05:45 PM
Re: DbGetRecordSet () Question
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
I am still having trouble...
Here is what I am doing..
code:
$DSN="DRIVER={SQL Server};SERVER=$Server;UID=m001kah;PWD=password;DATABASE=PSStartup" $Statement2 = "exec ff_trips_sp2 'PEYCLE','S','01/20/03','01/20/03'" ;Open connection to DB or at least try... ; ) $OpenConn = DBConnOpen ("$DSN") If @ERROR <> 0 If @ERROR = -2147352567 $LogLine = @TIME + " - unable to authenticate user $User" + @CRLF $Write = WriteLine (1,"$LogLine") $Silent = MessageBox ("Invalid SQL account information.","SMB ERROR : 200", 16) Exit 200 Else $LogLine = @TIME + " - general SQL error @ERROR detected." + @CRLF $Write = WriteLine (1,"$LogLine") $Silent = MessageBox ("General SQL error @ERROR detected.","SMB ERROR : 201", 16) Exit 201 EndIf EndIf
;Execute the stored procedure... ;===================================================================== $LogLine = @TIME + " - calling stored procedure against db." + @CRLF $Write = WriteLine (1,"$LogLine")
$ReturnArray = DBGetRecordSet($OpenConn,"$Statement2",4) If @ERROR <> 0 $WRITEERROR = @ERROR $WRITEERRORS = @SERROR $LogLine = @TIME + " - error $WRITEERROR returned from sp." + @CRLF $Write = WriteLine (1,"$LogLine") $LogLine = @TIME + " - error $WRITEERRORS returned from sp." + @CRLF $Write = WriteLine (1,"$LogLine") $Silent = MessageBox ("Error $WRITEERROR in SP execution - contact admin.", "SMB ERROR : 210", 16) Exit 210 EndIf
When I get to the part about executing the sp I get the following errors.
Error: -2147352567 SError: error COM exception error "Open" (Microsoft OLE DB Provider for ODBC Drivers - [Microsoft][ODBC SQL Server Driver]Syntax error or access violation) [-2147352567/80020009]
But when I log into QA with this account I have no problems running the sp. Any thoughts on what I am doing?
Thanks for the help thus far.
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#35730 - 2003-01-29 06:07 PM
Re: DbGetRecordSet () Question
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
I am not sure.... I will try to look into it. The error seems to have something to do with BLOB fields...
Hmmm...
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#35732 - 2003-01-29 06:24 PM
Re: DbGetRecordSet () Question
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
The field that the sp returns is only 2000 characters long. Shouldnt ba a problem. the other characters shounldnt be a prob either.
Thanks
_________________________
Austin Henderson
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 640 anonymous users online.
|
|
|