Run-Time error '-2147024703 (800700c1)' when running Access 2010 with SQL Server 2008 - sql-server-2008

I have an application written in MS ACCESS 2007 using VBA, connecting to an SQL Server at the back end. Both Access and SQL Server are running locally.
My machine runs Access 2010 and MS SQL Server Express 2008 R2 (both 32-bit, on WinXP) with no problem.
I have another machine, Win7 64-bit, running both Access 2010 and SQL Server 2008 (NOT R2) 64-bit.
When I run the Access application on the 64-bit machine, I have a drop down box to select the SQL Server which holds the various databases. When I select the server, after a few seconds I get an error:
Run-time error '-2147024703 (800700c1)':
Automation error %1 is not a valid Win32 application.
When I select the Debug option, the yellow arrow points to:
Set oServer = New SQLDMO.SQLServer
The next line is:
oServer.Connect ServerName, strSQLUser, strSQLPwd
In the watch list, I can see that ServerName, strSQLUser, and strSQLPwd hold the right values to access the SQL Server. I've tested these in sqlcmd and successfully was able to query tables.
Can anyone please help me out on this one? I'm not sure what to do next.

Seems like you've got registered a 32-bit SQLDMO on your system that is being used for connection to the 64-bit instance. Check your registry / file system for SQLDMO.dll versions and register the correct one.
Also check MSDN "Installing SQL-DMO" because SQLDMO was scheduled for remove after SQL Server 2008 R2:
Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
SQL Server Database Management Objects (SQL-DMO) has been removed from SQL Server 2008 R2 Express and the SQL Server 2008 R2 Feature Pack. SQL-DMO also does not support Database Engine features introduced after SQL Server 2000. We recommend that you modify applications that currently use this feature as soon as possible. If you must support SQL-DMO, install the Backward Compatibility Components from the SQL Server 2008 Feature Pack from the Microsoft Download Center. Do not use SQL-DMO in new development work; use SQL Server Management Objects (SMO) instead. You can obtain the SMO documentation by installing SQL Server 2008 R2 Books Online.

Thanks for this.
I looked to find SQLDMO.DLL 64-bit version, but although using the Backwards Comparability package for x64, installing using the MSI did not do the job.
I had to manually extract the files and place the correct version (which is ~2MB larger than the x86 version as an indication to knowing which one is the x64) and then run 'regsvr32 sqldmo.dll ' in the command line (very important: need to run cmd as Administrator for this to succeed).
After the module has been registered, my Access front end run great.

Related

SQL Server version mismatch

I'm trying to attach a SQL Server .mdf to my Management Studio 2014, but I get the error:
Attach database failed for Server '...\SQLINSTANCE'. (Microsoft.SqlServer.Smo)
Additional information:
An exception occured while executing a Transact-SQL statement or batch.
(Microfost.SqlServer.ConnectionInfo)
The database 'DatabaseName' cannot be opened because it is version 706. This server supports version 663 or earlier. A downgrade path is not supported.
Could not open new database 'DatabaseName'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)
The .mdf was created on SQL Server 2012 (which presumably is represented as 'version 706' in the error message).
OK, so I need to upgrade my DB engine to 2012 on my home PC. That means installing 2012 Express from https://www.microsoft.com/en-gb/download/details.aspx?id=29062
A couple of questions though before I do that. By installing 2012, would it be added to Management Studio 2014 automatically? Would I then have both 2008 & 2012 as options for new databases I might want to create, or would 2012 simply replace 2008?
On the download page, it says the supported OSs are "Windows 7, Windows Server 2008 R2, Windows Server 2008 Service Pack 2, Windows Vista Service Pack 2". But I'm using Windows 10. Is this just a case of MS not updating the page or does 2012 really have a problem with Windows 10?
EDIT: It's true that this question is similar to ones previously asked on SO (such as The database cannot be opened because it is version 706), but here I'm not contemplating rolling back the 2012 version of the DB to 2008, but issues pertaining to installing 2012 on my home PC.
So, your SQL Server version is 2008 - you have 2014 management studio and you need to use a database from a server version 2012.
If that is the case; then I hope some of the following will help:
Windows 10 can run SQL Server 2012 fine.
The documentation might just not be updated, but I've not personally seen any issues on multiple instances.
Management Studio 2014 can connect to SQL Server version 2012 as well. You don't need to install it again.
Unless you wish to remove SQL Server 2008, you'll need to install 2012 as a new instance, so you basically have two SQL Servers running. This however, will have affect on how you connect to the databases.
Check out, for example: https://msdn.microsoft.com/en-us/library/ms143531.aspx for more information
So instead of having multiple instances, consider whether you'll still need 2008, so it might be removed if you don't need it at all.
Also - consider whether it might be worth it to upgrade your local instance to newer version - 2014 for example. However this of course might give you the same problem in reverse in the future, if you ever need to make a database on 2014 instance and move it to a 2012 instance.
It all depends on the actual requirements, set-up and development models. Basically because you say it's your home computer, I'd think the newest version might just be the best approach, as you're less likely to use that version as a "creator" rather than a development version.

SSRS Remote server access

An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'DSView'. (rsErrorOpeningConnection)
The feature: "The edition of Reporting Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database." is not supported in this edition of Reporting Services. (rsOperationNotSupported)
Hi, I have encountered the above mentioned error while doing an SSRS project. And from the research, it seems like it is SQL server related issue.
I am trying to access a remote SQL server....so I was wondering how can I get rid of that error?
Do I have to install SQL server Standard edition on my local machine or the server that I am trying to access should be installed with Sql Standard edition?
I have got Express editions installed on both my local machine and the server...
Thx
From Books Online:
Report data sources must be SQL Server relational databases that run
locally in SQL Server Express.
Features Supported by Reporting Services in SQL Server Express.
With SQL Server Express you can only use a Data Source where the database engine is from the same instance running SSRS.
If you need to connect to other instances your only options are to get a backup restored to your local instance or to install a SQL Server edition that allows remote Data Sources; most likely Developer for your own needs or Standard or above for any production instances.
It depends on what's allowed under your specific licencing agreement.
A neat way to get around this (that just worked for me) is to add a Linked Server on the Local machine to point to the server that hosts your remote data source.
Then modify your Dataset query in the SSRS report to look something like this...
select * from openquery(REMOTE_SERVER,'Put your original query here');

Cannot attach 2008 R2 database to 2008 instance

So I have made a set up file and install it to target computer which has no .Net 4.0 or SQL Server 2008.
I add them as prerequisites and setup downloaded from the internet the .Net 4.0 and SQL Server 2008.
The setup finished successfully.
When I run the program, it gives an exception:
cannot open xxxxxx.mdf file. it is version 650. and your is xxx...
I searched it out and learned that SQL Server installed on target computer is lower than the database file I created (the database file was created in SQL Server 2008 R2).
So, no connections can be opened.
To solve this, What can I do?
Thank you...
You can't attach a 2008 R2 database to a 2008 instance - you can only go forward, not backward. So either install 2008 R2 at the destination, or you'll have to re-create your database in 2008. If you install 2008 locally alongside 2008 R2, you can create an empty database in 2008 and use tools like Red-Gate's SQL Compare / SQL Data Compare, or the schema compare feature in SQL Server Data Tools, to translate your database relatively quickly.
There is no way to open an MDF file with a lower version of SQLServer.
Of course you could add as a prerequisite SQLServer 2008 R2 (express or full).
But the best course is to distribute a SQL Script containing schema and data.
This could be done using SqlServer Management Studio,
Right click on the database
Select Task
Select Generate Script.
Follow the Wizard.
In the last page of the wizard you could find the button Advanced
Clicking on it will give you full control on what to put inside the script.
The script could be distributed with your application with instructions on how to execute on the target machine.

Install SQL Server 2008 R2 & .Net 3.5 during setup

I need to create a setup package that will not install SQL Server 2008 R2, a sample database, data and .Net 3.5 SP1 along with a setup installation.
I am using Visual Studio 2008. How do i do this?
Is it possible to install the full version, not express from setup package?
You can add other installers to setup packages; however it isn't normally customary to include one for SQL Server for the following reasons:
1, What if they have a different version installed (i.e. you are installing SQL Standard and they already have SQL Enterprise available)?
2, What if they have a SQL server installed on another server that they wish to use?
3, In a couple of years time Microsoft release the next version of SQL server and your software is still installing SQL Server 2008?
For the sample database and data just add the SQL in as a resource and get the app to run the script on first execution.

Visual Studio 2008 to MySQL connectivity

I am new to the Visual Studio.
I have MS SQL Server 2005 and 2008 preinstalled in my Windows Vista computer.
Are they real servers?
Or just some add-on for their server and I need to buy a server version of Windows for it?
If not,
How to run them?
How to add a database, etc.?
And basically how to connect Visual Studio 2008 to MS SQL Server 2008/2005 and MySQL?
I assume you mean that you have SQL Server Express installed when you say "ms sql server 2005 and 2008 preinstalled in my vista ". If not, you can download it for free; it is a lightweight version of SQL Server that has a few limitations (2GB max database size, max 10 connections, etc) but otherwise works more or less like the real thing and is great for development and/or learning.
Visual Studio should have a "servers" tab (by default on the right hand side) and there is a "Data Connections" node on it. Right-click on it to add your instance(s) of SQL Server. This will let you browse the tables/views and create new ones and will also let you create LINQ-to-SQL classes. If you want to access the database in code in other ways, you will need to read up on the System.Data.SqlClient namespace.