Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hey everyone.

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 prerequities and setup downloaded from the internet the .Net 4.0 and sql server 2008.
The setup finished succesfully. When I run the program, it gives an exception:

say: can not open xxxxxx.mdf file. it is version 650. and your is xxx...

I searched it out and learnt that the sql server installed on target computer is lower than the database file I created(The database file created in 2008 r2). So, no connections can be opened.

To solve this, What can I do?

Thank you...
Posted
Updated 21-Jun-12 7:03am
v4
Comments
OriginalGriff 21-Jun-12 4:36am    
What happened when you tried? Where did you have problems?
Un_NaMeD 21-Jun-12 4:49am    
When I run the setup.exe, an error poped out and says the installer can't be run. Don't understand why. is there any other way except the link?
OriginalGriff 21-Jun-12 5:02am    
Any particular error? Or just a big box that said "ERROR" and refused to give you any other information?
Un_NaMeD 21-Jun-12 8:35am    
it says: error 1001 exception occurred while initializing the installation...

1 solution

The problem is that you can not attach your mdf to an SQL instance that is lower than the version the mdf was created in. I might well be wrong but you will need to update your server with the R2 version of sql and not base 2008 version it is currently.

UPDATE 1

It just occurred to me that you could generate scripts for your 2008 database and use those scripts to create an R2 version on the server.

UPDATE 2

Just seen you other post about the same topic on StackOverflow:

http://stackoverflow.com/questions/11143612/cannot-attach-2008-r2-database-to-2008-instance[^]

People are suggesting the same. However, There is an interesting link here: http://robindotnet.wordpress.com/2011/02/06/how-about-a-bootstrapper-package-for-sqlserver-express-2008-r2/[^] on creating an SQL express 2008 R2 bootstrapper (pre-requsite) that you maybe able to use.

The only problem is that if we are talking about server environments, is it wise to have a pre-req in this manner? should the infrastructure support not be notified and manage a server upgrade (including service packs)??? Installing an application that does this for someone's server could be quite harsh???
 
Share this answer
 
v2
Comments
Maciej Los 21-Jun-12 17:18pm    
The OP knows it: "the sql server installed on target computer is lower than the database file I created". If i understand it good, He/She ask: How to attach database to ms sql server of lower version? But i'm not sure ;)
db7uk 21-Jun-12 17:26pm    
Yeah that's kind of what I thought and maybe I was not clear enough so apologies for that. What I was trying to say was that the OP can not do what he wants. SQL will not allow a higher version database to be attached to a lower version server. It is getting late and I may have really missed the point as my brain is failing. If it is I am sorry and will seek medical attention at one! :)
Un_NaMeD 22-Jun-12 2:46am    
Thank you for your answer.

Now I have some questions.

Update 1:

How can I create those scripts? What are they for? Are they recreate my database for sql server 2008?

Update 2: I'll look at that thread, but it's not supported by Microsoft I guess.

Is not any compatibility option to make r2 to 2008?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900