| Gabriel Mejía 2005-02-22, 3:55 pm |
| no. it has data
it works all the day with data. this code is just one that crashes. the
problem happen in all the asps. not just the one I put here.
I did the response.write thing a long time ago and is shows data. the
problem is not the query. I am sure of that because I did the response.write
of the query itself and paste it in the query analyser with valid results.
note: I was wrong in something. I am working with IIS 5
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> escribió en el mensaje
news:e0trQ3QGFHA.2588@TK2MSFTNGP09.phx.gbl...
> Gabriel Mejía wrote:
>
Server};server="+session("SGP")+";database="+session("Basedatos")+";uid="+se
>
> No, use SQLOLEDB.
>
> conectacadena="Provider=SQLOLEDB;" & _
> "Data Source=" & session("SGP") & ";" & _
> "Initial Catalog=" & session("Basedatos") & ";" & _
> "User ID=" & session("clavesgp") & ";" & _
> "Password=" & session("passsgp")
>
>
> No, use parameters. That's the whole point of using a Command object:
>
> sql14="SELECT * FROM dbo.tblOficinas WHERE strNombre=?"
>
>
>
> You're missing the "Set" keyword in the following statement. ALWAYS use
> "Set" when dealing with object variables.
>
> This statement should be:
>
> Set Recordset14=cmd.Execute(,array(nombreoficina))
>
> Then, don't try to read data from the recordset without checking its EOF
> property:
>
> If not Recordset14.EOF then
>
>
> Else
> Response.Write "The recordset was empty"
> End if
>
> If the recordset was empty when you think it should contain data, verify
> that nombreoficina contains the data you think it contains, by using
> Response.Write nombreoficina
>
> For further debugging, use SQL Profiler to trace the commands sent to your
> SQL Server.
>
> HTH,
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
|