Using vbscript I want to create a runtime html login page on the fly.

The html page should have username/pasword form and I will use this username/password to connect to a sql database.

Is there a way to create this runtimehtml page using vbscript and them collect the username/password from the page to connect to sql using a connection string?


visit my blog...

Recommended Answers

check out this might you an idea ;)

Jump to Post

All 4 Replies

I recommend against using VB for this as it requires users to have MSIE browsers only.

However, a workaround that is not seemingly mentioned Anywhere is the following...

in the tag script language=vbscript (if used)
remove the language definition and netscape/mozilla should be able to treat the page as ASP instead of looking for VBS in older browsers.

This also goes for the page header %vbscript%

Drop that completely to enable better cross browser support

I tried to coonect to a database as mentioned above and the link, but I am getting an error which says login failed for the user.

The connection string is:

strSQLconn = "Driver={SQL Server};Server=Servername;Database=dbname;" & _
             "Uid=username;Pwd=& strPw;"
objSQLconn.Open strSQLconn

strPw is the variable in which I am storing the password.
It works fine when I do it without the login form.

Can anyone tell me why this error is showing up?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.