0

I am trying to build a datagrid in Classic ASP. I have read a few articles here and there and am trying to use MSDataShape to implement this.

I have never worked with MSDataShape, so have absolutely no idea about it.


'Create the ADO Connection object. 
set oCon = Server.CreateObject("ADODB.Connection") 

'--- Generate the connection string 
sCon = "Data Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;" 
sCon = sCon & "Data Source=" & Server.MapPath("Northwind.mdb") 
oCon.ConnectionString = sCon 

'--- Specify that we will use the Data Shaping provider. 
oCon.Provider = "MSDataShape" 

'--- Open the connection 
oCon.Open 

I get the following error:

Microsoft OLE DB Service Components error '80040154' Class not registered /DG/test.asp, line 39 –

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
cjv
  • 51
  • 1
  • 2
  • 12
  • here is my code. '--- Create the ADO Connection object. set oCon = Server.CreateObject("ADODB.Connection") '--- Generate the connection string sCon = "Data Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;" sCon = sCon & "Data Source=" & Server.MapPath("Northwind.mdb") oCon.ConnectionString = sCon '--- Specify that we will use the Data Shaping provider. oCon.Provider = "MSDataShape" '--- Open the connection oCon.Open I get the following error: Microsoft OLE DB Service Components error '80040154' Class not registered /DG/test.asp, line 39 – cjv Oct 11 '12 at 07:48
  • I tried my best to put this code in the main question, but it would not accept the code no matter what i tried. 4 spaces, > marks .... nothing seem to work. Sorry about this. – cjv Oct 11 '12 at 07:49

1 Answers1

0

The error message indicates that the data provider you specified can't be found. In this case, 3.51 is a very old version of Jet. Try using the following:

sCon = "Data Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;"

Also, if you're on a 64-bit OS, make sure you configure your application pool to run in 32-bit mode.

Community
  • 1
  • 1
Cheran Shunmugavel
  • 8,319
  • 1
  • 33
  • 40