Forum Moderators: open

Message Too Old, No Replies

SQL Express & Classic ASP problem

Having problems with connection string - I think...

         

The Cornishman

10:59 am on Feb 13, 2009 (gmt 0)

10+ Year Member



Hello everyone,

I am a complete novice when it comes to SQL in any form, so thought it time to gain some experience. To this end I downloaded the free version of SQL Express, and created a database and one simple table via Visual C# Express Edition.

I then uploaded the .mdf file to the correct place on my hosting company's server (predefined /databases folder) and attempted to write a classic asp script to access the data. No luck so far.

My website hosting is with < removed >, and I have been trying to find out from them what migfht be the problem. I think they have tired of my questions now though...

I have in particular tried several different variations on the connection string, all without success.

I am currently getting the error message

Provider error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/test.asp, line 10

... when running my script, which looks like this:

<%
Dim objCon, strSQL, objRS, strCon, i

'Create connection object
set objCon = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

ConnectionString = "Provider=SQLNCLI;Server=.\SQLEXPRESS;AttachDbFilename=d:\websites\jewe949720\databases\Database1.mdf;Initial Catalog=JewelleryTree;Integrated Security=True;User Instance=True"

objCon.Open (ConnectionString)

strSQL = "SELECT * FROM JewelleryPieces"
set objRS = objCon.execute(strSQL)
%>

... followed by some HTML/further asp statements to display the results ...

Incidentally the path to the database AttachDbFilename= etc, was given to me by Redstation, so I'm fairly sure that is correct at least.

Does anyone know what my problem might be? I know there are different forms of the connection string, and I am not sure whether for example the first elements of the string:

Provider=SQLNCLI;Server=.\SQLEXPRESS;

are correct for my setup...

I hope this is not too vague to be understood. This just cannot be as complicated as it feels!

Any help would be greatly appreciated. Thank you in advance.

[edited by: tedster at 8:59 pm (utc) on April 25, 2009]
[edit reason] no specific webhosts, please [/edit]

thesimpsonator

11:56 am on Apr 24, 2009 (gmt 0)

10+ Year Member



hi m8, I'm having similar bother connecting also, and seem to be getting the same 'feedback'!

did you have any joy with this?

regards

chris

[edited by: tedster at 9:00 pm (utc) on April 25, 2009]