Richard
Wed Mar 15 14:12:33 CST 2006
My best guess is an authentication issue in asp. Trusted_Connection=Yes
means use Windows Integrated authentication, which you indicate works in
VB6. My guess is you don't have permission in ASP. Maybe you could test this
theory by granting public rights to the database temporarily in SQL
Enterprise Manager. Otherwise, you need to post in an ASP newsgroup.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
"Bob and Sharon Hiller" <aoklans@tir.com> wrote in message
news:uUPMjpFSGHA.1780@TK2MSFTNGP12.phx.gbl...
> Richard,
> I changed my code as you suggested and I am not getting any records.(there
> are currently 2054 rows in the table)
>
> Here is what I have:
> Set adoConnection = server.CreateObject("ADODB.Connection")
> Set adoRecordset = server.CreateObject("ADODB.Recordset")
> adoConnection.ConnectionString = "Provider=MSDASQL.1;" _
> & "Persist Security Info=False;" _
> & "Extended Properties=Description=Large Pump Data Source;" _
> & "DRIVER=SQL Server;SERVER=LPDATASYSTEM\PL3LP;" _
> & "APP=Microsoft Data Access Components;" _
> & "WSID=LPDATASYSTEM;DATABASE=LargePump;" _
> & "Trusted_Connection=Yes;Initial Catalog=LargePump"
> adoConnection.Open
>
> adoRecordset.ActiveConnection = adoConnection
> Dim SqlSelect
> SqlSelect = "select * from [LargePumpFloor_TS1] order by Row_num"
> adoRecordset.CursorLocation = 3
> adoRecordset.CursorType = 3
> call adoRecordset.Open(SQLSelect)
> adoRecordset.PageSize = 12
> adoRecordset.CacheSize = adoRecordset.PageSize
> intPageCount = adoRecordset.PageCount
> intRecordCount = adoRecordset.RecordCount
>
> Do you see anything else wrong? I am running IIS on Windows XP Pro with MS
> SQL Server 2005. I can access and see any MS Access Database but no SQL
> databases. Is there a msgbox statement or equivalent that I can use to
> variables as the script executes and a web page?
>
>
> "Richard Mueller" <rlmueller-NOSPAM@ameritech.NOSPAM.net> wrote in message
> news:%232nvQ%23ESGHA.5036@TK2MSFTNGP12.phx.gbl...
>>
>> "Bob and Sharon Hiller" <aoklans@tir.com> wrote in message
>> news:eLQabvESGHA.4440@TK2MSFTNGP11.phx.gbl...
>>> I have an ASP page that was done in VBScript
>>> It is setup to read an Access database and I need to change it to
>>> read
>>> a Sql 2005 Database.
>>>
>>> The code that is used to open the Access Database:
>>>
>>> Set adoConnection = server.CreateObject("ADODB.Connection")
>>> Set adoRecordset = server.CreateObject("ADODB.Recordset")
>>> adoConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
>>> Dim strLocation, iLength
>>> strLocation = Request.ServerVariables("PATH_TRANSLATED")
>>> iLength = Len(strLocation)
>>> iLength = iLength - 11
>>> strLocation = Left(strLocation, iLength)
>>> strLocation = strLocation & "../Database.mdb"
>>> adoConnection.Open ("Data Source=" & strLocation)
>>> adoRecordset.ActiveConnection = AdoConnection
>>>
>>>
>>> In my VB 6.0 app I use the following to open the SQL Database"
>>>
>>> Set DataBaseTS_1 = New ADODB.Connection
>>> DataBaseTS_1.ConnectionString ="Provider=MSDASQL.1;Persist Security
>>> Info=False;Extended
>>> Properties=Description=Large Pump Data Source;DRIVER=SQL
>>> Server;SERVER=LPDATASYSTEM\PL3LP;APP=Microsoft Data Access
>>>
>>> Components;WSID=LPDATASYSTEM;DATABASE=LargePump;Trusted_Connection=Yes;Initi
>>> al Catalog=LargePump"
>>>
>>> DataBaseTS_1.Open
>>>
>>> How can I get the VBScript to open the SQL Database?
>>>
>>> Thanks,
>>> Bob Hiller
>>> Lifts for the Disabled LLC
>>
>> Hi,
>>
>> I would try:
>>
>> Set adoConnection = server.CreateObject("ADODB.Connection")
>> Set adoRecordset = server.CreateObject("ADODB.Recordset")
>> adoConnection.ConnectionString = "Provider=MSDASQL.1;" _
>> & "Persist Security Info=False;" _
>> & "Extended Properties=Description=Large Pump Data Source;" _
>> & "DRIVER=SQL Server;SERVER=LPDATASYSTEM\PL3LP;" _
>> & "APP=Microsoft Data Access Components;" _
>> & "WSID=LPDATASYSTEM;DATABASE=LargePump;" _
>> & "Trusted_Connection=Yes;Initial Catalog=LargePump"
>> adoConnection.Open
>>
>> In VBScript I personally use:
>>
>> strDB = "MyDatabase"
>> strServer = "MyServer"
>> strInstance = "MyInstance"
>>
>> strConnect = "DRIVER=SQL Server;" _
>> & "Trusted_Connection=Yes;" _
>> & "DATABASE=" & strDB & ";" _
>> & "SERVER=" & strServer & "\" & strInstance
>>
>> Set adoConnection = CreateObject("ADODB.Connection")
>> adoConnection.ConnectionString = strConnect
>> adoConnection.CommandTimeout = 120
>> adoConnection.Open
>>
>> --
>> Richard
>> Microsoft MVP Scripting and ADSI
>> Hilltop Lab -
http://www.rlmueller.net
>>
>>
>
>