Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 16th, 2004, 10:26 PM
Registered User
 
Join Date: Nov 2004
Location: Dhahran, East, Saudi Arabia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Syed Naveed Khursheed Send a message via Yahoo to Syed Naveed Khursheed
Default Invalid object name

Greetings,

I am trying to connect to SQL database via MSDE using try it out in chapter 12(pg.475). The problem is that I keep getting this message:

Microsoft OLE DB Provider for SQL Server (0x80040E37)
Invalid object name 'Movies'.
/begasp/connect.asp, line 35

I have checked the code and there seems to be no problem. I tried working with Access it is running perfectly. I would really appreciate any help. Thanks in advance, my code is as follows:

Code:
dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable = 2

dim objConn, objRS
set objConn = server.CreateObject ("ADODB.Connection")
set objRS = server.CreateObject ("ADODB.Recordset")

dim strDatabaseType
'strDatabaseType = "ACCESS"
strDatabaseType = "MSDE"

if strDatabaseType = "ACCESS" then
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &_
        "Data Source=C:\datastores\Movie2000.mdb;" &_
        "Persist Security Info=False"
else
objConn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" &_
        "User ID=sa;Data Source=NAVEED-HOME;" &_
        "Initial File Name=C:\MSSQL7\Data\MovieMSDE.mdf"
end if

objRS.Open "Movies", objConn, adOpenForwardOnly,adLockReadOnly, adCmdTable

While not objRS.EOF
    Response.Write objRS("Title") & "<br>"
    objRS.MoveNext
wend

objRS.Close
objConn.Close
set objRS = nothing
set objConn = nothing

Syed Naveed Khursheed
  #2 (permalink)  
Old November 17th, 2004, 01:16 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Does Movie2000.mdb contains movies table?

Om Prakash
  #3 (permalink)  
Old November 17th, 2004, 06:38 AM
Registered User
 
Join Date: Nov 2004
Location: Dhahran, East, Saudi Arabia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Syed Naveed Khursheed Send a message via Yahoo to Syed Naveed Khursheed
Default

Actually I only have MSDE, frankly I do'nt know how can I open the database to check, any suggestions? I have downloaded the database file MovieMSDE.mdf from the wrox website and also the access version of the same program is working fine, I presume that it should have "Movies" table.

Thanks

Syed Naveed Khursheed
  #4 (permalink)  
Old November 17th, 2004, 07:08 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

you need to restore the database and then use it. You have to use SQL server and not Microsoft.Jet.OLEDB.4.0 drivers.



Om Prakash
  #5 (permalink)  
Old November 17th, 2004, 07:35 AM
Registered User
 
Join Date: Nov 2004
Location: Dhahran, East, Saudi Arabia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Syed Naveed Khursheed Send a message via Yahoo to Syed Naveed Khursheed
Default

Thanks for the quick response, actually I am using the SQLOLEDB Provider, if you look at the code more carefully you will see that I am using a string variable to store the database type and based on the value of that string I am deciding which connection string to use. In this case the access database and hence the microsoft jet provider is commented out.

Regards

Syed Naveed Khursheed
  #6 (permalink)  
Old November 17th, 2004, 08:19 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

I think you don't have a valid MSDE installation. You can get the latest version from the following link:

http://www.microsoft.com/downloads/d...DisplayLang=en

Please read the Readme for installing the MSDE part. You have to use some command line stuff to get your installation and Named Instance to be setup correctly.

Om Prakash
  #7 (permalink)  
Old November 17th, 2004, 02:40 PM
Registered User
 
Join Date: Nov 2004
Location: Dhahran, East, Saudi Arabia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Syed Naveed Khursheed Send a message via Yahoo to Syed Naveed Khursheed
Default

I tried re-loading the MSDE but no luck (I tried installing with switches). I am getting desperate now, it has been more than 18 hours and I am stuck.

Thank you very much

Syed Naveed Khursheed
  #8 (permalink)  
Old November 17th, 2004, 05:01 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're using an incorrect (outdated? Obsolete? Illegal?) connection string.

Take a look here: http://www.able-consulting.com/MDAC/...erForSQLServer

You need something like:

oConn.Open "Provider=sqloledb;" & _
           "Data Source=myServerName;" & _
           "Initial Catalog=myDatabaseName;" & _
           "User Id=myUsername;" & _
           "Password=myPassword"

Where myServerName takes the form of ServerName\InstanceName if you have a named instance of the MSDE. EG: DevelopmentMachines\VsDotNet

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #9 (permalink)  
Old November 20th, 2004, 01:42 AM
Registered User
 
Join Date: Nov 2004
Location: Dhahran, East, Saudi Arabia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Syed Naveed Khursheed Send a message via Yahoo to Syed Naveed Khursheed
Default

Thanks Imar,

I an actually using the same connection string as you recommended, which was
oConn.Open "Provider=sqloledb;" & _
           "Data Source=myServerName;" & _
           "Initial Catalog=myDatabaseName;" & _
           "User Id=myUsername;" & _
           "Password=myPassword"

In my case myServerName is Naveed-Home and User ID is sa, with no password, I tried the same with Initial Catalog switch also. Could you please elaborate where am I wrong?

Thanks in advance

Syed Naveed Khursheed
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid object dbo.split error............ hepsy.i ASP.NET 1.0 and 1.1 Professional 1 August 8th, 2007 06:31 PM
invalid object name 'Groups' marco_27 VB Databases Basics 3 April 16th, 2007 01:59 PM
Invalid Object Name "Groups" Charlie05 VB Databases Basics 4 April 14th, 2007 10:54 AM
"Invalid object format name" Error welles Crystal Reports 2 September 27th, 2006 04:42 AM
Invalid Object Name busybee ASP.NET 1.0 and 1.1 Professional 1 July 5th, 2006 11:13 PM



All times are GMT -4. The time now is 04:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.