2

ちょっとすべて私はクラシックASPで私のSQLサーバーバージョン10.50.2500への接続を取得しようとしています

.aspページの私のコードは次のとおりです(私が使用しようとしたすべての接続文字列を含む):

Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS   = Server.CreateObject("ADODB.Recordset")

'objConn.ConnectionString = "Provider={SQL Server};Server=xxx.xxx.xxx.xxx\SQLEXPRESS;Database=JForm;User ID=xxxx;Pwd=xxxx"
'objConn.ConnectionString = "Driver={SQL Server};Server=xxx.xxx.xxx.xxx\SQLEXPRESS;Database=JForm;Uid=xxxx;Pwd=xxxx;"
'objConn.ConnectionString = "Provider=SQLNCLI10;Server=xxx.xxx.xxx.xxx,1433;Database=JForm;Uid=xxxx;Pwd=xxxx;Persist Security Info=True"
'objConn.ConnectionString = "Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=JForm;Uid=xxxx;Pwd=xxxx"
objConn.ConnectionString = "Driver={SQL Server Native Client 10.0};Server=xxx.xxx.xxx.xxx\SQLEXPRESS;Database=JForm;Uid=xxxx;Pwd=xxxx"

strSQL = "UPDATE jURLS " & _
        "SET rssFeedURL = 'http://www.xxxx.com/rss/" & rss & "'," & _
        "csvURL = 'http://www.xxxx.com/csv/" & csv & "'," & _
        "jFormName = '" & forname & "'," & _
        "isActive = " & active & " " & _
        "WHERE jFormName = '" & forname & "'"

objConn.open
objRS.Open strSQL, objConn, 1,3

'If Not objRS.EOF Then
 'iterate through records here
'Else
 'no records found
'End If

objRS.close
Set objRS=Nothing
objConn.close
Set objConn=Nothing

objConn.openでクラッシュするようです。ただし、500-内部サーバーエラーしか発生しません。役立つエラーではありません!

ページからデータベースコードを取得して他のすべてを残すと、500-内部サーバーエラーが表示されずに機能します。

これを機能させるために他に何を試すことができますか?

4

2 に答える 2

1

ここに余分なコンマがあります:

"isActive = " & active & "," & _

次のように変更します。

"isActive = " & active & " " & _

接続エラーについては、connection.errorsコレクションを使用してデバッグしてみてください

On Error Resume Next
objConn.open

for each errobj in objConn.Errors
    Response.write errobj.Number & "<br />"
    Response.write errobj.Description & "<br />"
next

On Error Goto 0
于 2012-11-29T05:39:47.110 に答える
0

試す:

response.write(strSQL) <-- this will allow you to look at your current SQL statement and see if it makes sense.
set objRS = objConn.execute(strSQL)
于 2012-11-28T21:16:21.257 に答える