Connecting to MS SQL 2000 problem

can't connect to database

Page 1 of 1

7 Replies - 1591 Views - Last Post: 20 July 2010 - 04:38 AM

#1 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Connecting to MS SQL 2000 problem

Posted 13 July 2010 - 07:27 AM

Hello DreamInCode members,

I'm trying to make some program in BCBuilder (C++) that needs to connect with MS SQL Server 2000 using TADOConnection object.
I have installed MS SQL Server 2000 with Windows Autentication, and Server Autentication ('sa','sa').
After that i have created database named 'db10305' and in it table 'user' with fields 'username'
and 'password'.Then in Query Analyzer i have inserted one row to that table with command "insert into user values('admin','admin')"

In BCBuilder i have created two forms: LoginForm and one (for now) empty form.

Here is the part of code where i specify connecting parameters:

   conn=new TADOConnection(NULL);
   conn->ConnectionString="Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog = db10305;Integrated Security=SSPI";
   conn->Open("sa","sa");
   conn->LoginPrompt = false;



When i try to run application i'm getting exception with message <'Error creating object.Please verify that Microsoft Data Access Components 2.1(or later) have been properly installed. Process stoped.Use Step or Run to continue.'>

I have attached existing files codes to this post.

I doubt that problem is in ConnectionString parameters. I appreciate any advice.

Attached File(s)

  • Attached File  Code.txt (6.29K)
    Number of downloads: 129

This post has been edited by vvozar: 13 July 2010 - 10:35 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Connecting to MS SQL 2000 problem

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Connecting to MS SQL 2000 problem

Posted 13 July 2010 - 03:33 PM

Hate to be obvious but

Quote

Please verify that Microsoft Data Access Components 2.1(or later) have been properly installed.

did you do that?
Was This Post Helpful? 0
  • +
  • -

#3 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Re: Connecting to MS SQL 2000 problem

Posted 13 July 2010 - 05:25 PM

I think that everything was installed properly.
I'm using Vista and under Start->Programs->Microsoft SQL Server are installed next services/components:

- Books Online
- Client Network Utility
- Configure SQL XML Support in IIS
- Enterprise Manager
- Import And Export Data
- Profiler
- Query Analyzer
- Server Network Utility
- Service Manager

Service Manager is starting with Vista and running in background. I was using Query Analyzer to create database and insert table.
Although when installing MS SQL Server 2000 I had to make some changes in Registry. You can see the installation procedure explained here http://support.microsoft.com/kb/312995
Following these instructions I have installed MS SQL Server 2000 'smoothly'.

When i try to run application, Exception occurs, and when i close that exception dialog BCBuilder opens ADODB.hpp unit in Editor Window with this line highlighted

/* TCustomADODataSet.Create */ inline __fastcall virtual TADODataSet(Classes::TComponent* AOwner) : TCustomADODataSet(AOwner) { }

This post has been edited by vvozar: 13 July 2010 - 05:35 PM

Was This Post Helpful? 0
  • +
  • -

#4 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Re: Connecting to MS SQL 2000 problem

Posted 14 July 2010 - 01:29 AM

Quote

"Please verify that Microsoft Data Access Components 2.1(or later) have been properly installed."
did you do that?

There are instructions on How to check MDAC version here : http://support.microsoft.com/kb/301202 I have downloaded 'Component Checker', but when i try to run it, it says that "Component Checker is not supported on Vista, since MDAC files are protected on these platforms."
Anyway, to make sure, i've downloaded MDAC 2.8 ( http://www.microsoft...&displayLang=en )
but i'm getting still the same error.

This post has been edited by vvozar: 14 July 2010 - 02:02 AM

Was This Post Helpful? 0
  • +
  • -

#5 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Re: Connecting to MS SQL 2000 problem

Posted 14 July 2010 - 04:16 AM

Don't knowing what to do, i've uninstalled MSSQL Server 2000 and installed it again. The server is MS SQL Server 2000 Personal Edition. These are the options that i've choosen during installation process (by installation steps):

1. Install MS SQL Components
2. *Local Computer
3. *Create a new Instance of SQL Server, or install Client Tools
4. entered Serial Number
5. *Server and Client tools
6. in 'Instance Name' form i left "Default" check-box checked
7. Use the same account for each service
*Use the Local System Account, with checked "Auto Start" check-box
8. Mixed Mode - Windows and Server Autentication, with username "sa" and password "sa"
9. Finish.

Again created 'db10305' database and table 'user'.
Still getting same error.Any suggestion?
Was This Post Helpful? 0
  • +
  • -

#6 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Re: Connecting to MS SQL 2000 problem

Posted 14 July 2010 - 05:07 AM

I changed ConnectionString to:
conn->ConnectionString="Provider=SQLOLEDB;Data Source=(local);Initial Catalog=db10305";

(deleted ";Integrated Security=SSPI" and space before and after equation mark of 'Initial Catalog' attribute), but still getting same error exception.
Was This Post Helpful? 0
  • +
  • -

#7 vvozar   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 04-August 09

Re: Connecting to MS SQL 2000 problem

Posted 20 July 2010 - 04:14 AM

Problem solved! It seems that Vista is main culprit for connecting issue. I installed MS SQL Server 2000 and BCBuilder on my old computer that has Windows XP, to try if its going to work there. And I managed to connect to database in first attempt. There are many posts all over internet saying that MS SQL Server 2000 is not compatible with Vista. It seemed like it was running in background, but obviously something is wrong. So, i lost one more day downgrading from Vista to XP, but at least i can continue developing project.
Was This Post Helpful? 1
  • +
  • -

#8 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Connecting to MS SQL 2000 problem

Posted 20 July 2010 - 04:38 AM

Glad you got it figured out and thank you very much for posting the solution! I really couldn't be any more help as I don't use MS SQL.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1