Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Errors

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I develop currently in VB..I am getting into vbscript with ASP. I am trying to connect to a simple access database using the following code.

Dim cnn, strCnn

strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DB.mdb"

Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open strCnn

I get the foloowing error..

apartment thread componets cannot be created.

Like i said, i know VB pretty good it's the vbscript thats seems to be a little confusing to me. can someone tell me what refrences i should be added and maybe some connection and recordset examples...I am using ASP.NET

thanks in advance..
 
Whew.

I'm far from an expert having only played with early betas of .Net before I realized it wouldn't buy me much, due to the vast amount of legacy code I need to support and the radical departure that .Net represents.

But as far as I know, ASP.Net doesn't really support VBScript. You need to write your ASP.Net pages using VB.NEt, C#, etc. Seems to me VBScript doesn't exist in the .Net universe.

Your code fragment sure LOOKS LIKE VBScript, but are you sure it isn't being interpreted as VB.Net instead? Both the syntax and symantics there differ a lot from those in standard ASP, WSH, or DHTML.

Maybe you should consider addressing this issue to the VB.Net forum?
 
On further reflection, I think IIS will still accept old-style ASP pages as long as they're named xxxx.asp instead of xxxx.aspx - even when IIS is ".Net enabled."

Maybe we need to see a larger fragment of your code, including code-escapes and other meta-symbols (the <% %> and other symbols)?

Another good place to ask this is in the ASP forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top