2

Here is my vbscript - not got too far with this. The 2 lines I've lifted from Microsoft documentation don't work. The file is saved as a vbs file. I'm doubleclicking to run. Windows XP is the OS.

option explicit

Dim Rs1
Set Rs1 = Server.CreateObject( "ADODB.Recordset" )

I get a runtime error saying error: variable is undefined: 'Server'. Bit puzzled by this as the code is sooooo basic.

Any ideas anyone? thanks...

1 Answer 1

7

Server.CreateObject is for ASP Pages, for "desktop" VBScript use:

option explicit

Dim Rs1
Set Rs1 = CreateObject( "ADODB.Recordset" )
Sign up to request clarification or add additional context in comments.

1 Comment

Server.CreateObject("ADODB.Recordset") and CreateObject("ADODB.Recordset") work with Classic ASP: <%@language="VBSCRIPT" CODEPAGE="65001" LCID=1033%>. I guess it depends on how IIS is set up and how your files and folders security is set.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.