I am having trouble getting a dsn-less connection to a sql 2000 server using vbscript in a asp page.
I am trying to make the connection in a vbscript function and then call the function from an onClick button event.
I tested the connection code in a seperate blank asp page without putting it in a function and it worked fine. As soon as I include it in a function I am recieving the following error:
Error: Object required: 'Server'
Here is the function that I am using:
Here is my function call:
I am trying to make the connection in a vbscript function and then call the function from an onClick button event.
I tested the connection code in a seperate blank asp page without putting it in a function and it worked fine. As soon as I include it in a function I am recieving the following error:
Error: Object required: 'Server'
Here is the function that I am using:
Code:
<script language = vbscript>
function test()
Dim strConn, objConn
strConn = "Provider=SQLOLEDB.1;SERVER=ip address;DATABASE=MASTER;UID=SA;PWD=password"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(strConn)
objconn.Execute("sp_dtsPackage")
objConn.close
Set objConn = Nothing
end function
</script>
Here is my function call:
Code:
<BUTTON TYPE=BUTTON onClick=test()><p>Update Accounts</BUTTON>
[code]
I am new to asp and vbscript and would appreciate any help you can give.
Thanks in advance.
-Jim