Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Tuesday, March 20, 2012

ACCESS2SQLSERVEREXPRESS

Hello,

First of all, please excuse my english... I'm french :-D

Can someone give me a way to convert an Access2 DB to a SQL Server 2005 Express ?

Is it possible ?

Thanks,

I managed to export datas from ACCESS2 DB in text format.

Can I insert from a text file datas in SQLExpress ? Even if I don't need all the fields ?

Thanks,

|||

Is this a silly question ?!?

I read that SSIS is not in SQL Server Express and I'm trying to find a way to import Access2 DB to SQL Server Express DB...

|||

There is tool from Microsoft to convert Access Database into SQL Server 2005 database. I have no link for it. You can search it from Microsoft's website.

|||

For importing text files into SQL Express, take a look at the BCP tool, more information is in the BOL.

You can also take a look at the SQL Server Migration Assistant for Microsoft Access. I'm not sure this tool is capable of working with Access 2.0 databases, since that version hasn't been supported for some time now.

Another possibility would be to try the built in Export functionality in Access to export data directly to SQL Server.

Mike

|||

Thank you very much ! I have never heard about this SQL Server Migration Assistant, even when I was searching in MS website. It is exactly what can help me and it works with Access2.

Thanks a lot again

Best regards

Nico

Access/Server

How do you change the connection string of a DataSet?

We have been using MSAccess for our database, but have recently upgraded to SQLServer Express. I was able to successfully upsize the Access database and now all information resides on the server. In my VisualBasic program, the dataset itself has around 200 queries total spread out on multiple table adapters. The problem now is that none of these queries work because the dataset is bound to the Access table. I have changed connection string through code and am able to display the information, but am unable to interact with it until i get the dataset connection changed.

I would rather just change the connection of the dataset somehow rather than build a new dataset, reconnect all forms, and rewrite all tableadapter queries.

Thank you for any help that you can provide.

Hi,

Not knowing which versions of VB and SqlExpress you are using makes it difficult for me to give any practical help, especially as I'm not familar with using prior versions, but the following may be of some use to you.

I've been using VisualStudio2005Pro and SqlExpress2005 for some time, and if its practical for you to upgrade to Visual Studio Express etc.(which is now free), you may find your problem easier to solve. In VS2005, you can use the My.Settings to hold your connection string, which makes it much easier to control. I recently changed from using SqlExpress in User Instance mode to Server mode, which meant having to alter nearly 300 connection string references. By using the find and replace facility in VS2005 (Ctrl F) it took maybe five minutes max to make the changes, including changing the connection string in My.Settings.

You can then always access your database using a connection like dbConnection = New SqlConnection(MySettings.Name of your ConnectionString)

John

|||Thank you for the response. To give a little bit more information i am currently using SQLExpress 2005 and using Visual Studio 2005 Pro as well.

The dataset that i have created in the program that is bound to all of my fields i have done extensive work in developing. Each table adapter in the dataset has anywhere from 1 - 50 queries on it. Just a few days ago i was instructed to change our database from MSAccess to SQLServer. I upsized the data and had no problems. I then changed the ConnectionStrings in the VB program since i was unaware of a way to change the connectionstring of the dataset itself (when you create the dataset, it asks for type of database, and location). With the new connection strings at the top of each form, i am able to access all of the data when i go from form to form. The problem lies when i try to add, change, delete, etc data on a form. Since the add/update/delete/etc call the queries that are located in the table adapters, it is still trying to access the old MSAccess database because that dataset (and the table adapters) are bound to the Access database since creation. When i go in to "Configure DataSet With Wizard", it will let me hit "Previous" for a few screens until i get to the location where i chose the datasource. These fields now are darkened and will not allow me to change the location/type of database that the DataSet is bound to. If there is an easy way to directally change the DataSet bindings without having to re-create the entire dataset i would rather go that path. The other problem lies with the table adapter queries. I recently re-wrote the smaller program's dataset instead of trying to figure out a way to convert it when i realized that the SQL commands for the Table Adapters of MSAccess and SQLServer are so completely different. If i will need to rewrite the SQL queries either way, then i might as well just start from scratch with a new dataset that is bound to the server instead of access.

If there is any other information i can provide please let me know. Thank you so much for the response.|||

With my limited knowledge I'm afraid I am not going to be of much help to you.

When I started with VS2005, I made the conscious decision to not use the wizards when working with datasets, tableAdapters etc, purely so as to have better control. It was a lot more work as a beginner, but has paid off, I believe, in ease of maintaining things. The downside is I dont have the experience which could maybe help you.

I'm sorry I'm out of my depth with regards to your particular problem, however I had a look at the msdn site and found the following site http://msdn2.microsoft.com/en-us/library/76ah1sx7.aspx has some information which you may be able to use.

How to: Edit a Dataset: Edit a TableAdapter: Edit TableAdapter Queries. etc.

I hope you find what you need there. Sorry I cannot be of more assistance. Maybe some of the other readers of this site can be more helpful

Good Luck

John

|||

There is probably some way to do this using the Data Set Wizard, but I haven't quite figured it out. If you created the original DataSet using the wizard though, it actually saved the connection string it uses into your application Settings, so you can just modify the string there.

Just open the application properties and switch to the Settings page. You should see a connection string setting. Just change the connection string, but not the setting name. As long as everything else is exactly the same, table names ,etc., it should just work.

Let me know how it turns out.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||You have it exactally right on. I went into the settings and was able to change the string with out any difficulty. I am getting a few errors now but i think that they will be easy to resolve.

Server=ACSFRONTDESK\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ALTDB.mdf;Database=ALTDB;Trusted_Connection=Yes;

Connection Failed;
SQLState: '42000'
SQL Server Error: 1801
Database 'c\.................\ALTDB.mdf' already exists.
Connection Failed;
SQLState: '42000'
SQL Server Error: 1832
Could not attatch file "C:\.................\ALTDB.mdf" as database 'ALTDB'.

From the looks of it, it is trying to copy it over for some reason. I see that in the connection string it says "AttachDbFilename" but i am not sure what it is for. I did delete that section out of the string and i still got the same message.

It is also not letting me log in to the database at all now giving me some a different error in the program that did have a successful connection:

An error occurred while retrieving the information for the database;

Can not open user default database. Login Failed.
Login failed for user.

All of the connections i have to the database are through TrustedConnection and Windows Authentication. As i said, this is the one connection that kept working even after the "expandos" droped out of the Managment Studio. I will keep playing with it to see if i can come up with anything else. If i am using the incorrect connection string please let me know. I have tried several different variations of the string and none have been successful.|||

If the database is already attached at the server you should not need to specify AttachDbFileName. This keyword is used to cause SQL to automatically attache the database when an application starts. I'd recomend using the following:

Server=ACSFRONTDESK\SQLExpress;Database=ALTDB;Trusted_Connection=Yes;

Mike

|||I have entered the new connection string. I am getting 1 error as i try to synchronize the DataSet and that is:

An error occurred while retrieving the information for the database;

Can not open user default database. Login Failed.
Login failed for user.

This i am sure i can get rid of once i get the database back up and running properly. Thank you so much for your time and help in resolving this issue.
|||

Hope this post is not out of place, but I have a question for Mike.

Using SqlExpress, I use the following connection string:

Data Source= .\SqlExpress;Initial Catalog=Bradview;integrated Security = True which is somewhat different to the example you showed above. Does it do exactly the same thing.?

John

|||

Too many Johns on this thread!

The two are functionally equivalent as far as I can tell. 'Data Source' specifies the same information as 'Server' and 'Database' specifies the same information as 'Initial Catalog'. I have not worked out what the difference is between these syntaxes, but they are used interchangably in my experience.

There is probably some eceedingly technical reason for these different keywords. I welcome comments from anyone who might know what they are.

Mike

|||

Thanks Mike,

The explanation does make me feel better. I've been trying to help where I think I can add to someone's knowledge, expecially a beginner like myself, but decided I was probably doing more harm than good, so have kept my mouth shut lately (so to speak).

I'd also be interested to know the differences in the keywords, if it's a major point of difference.

There can never be too many Johns.!! <grin>

Thanks again

John

|||One more question about this matter. As i said i used the connection string that you provided me Mike and it works perfect on one of the 2 programs. The other program however errors out and says that i need to include a 'Provider' in the connection string. I did this with a few different 'Providers' and have now come across a weird thing.

The SQL statments inside my DataSet (each table adapter allows you to Add Query) between the 2 programs are now vastly different. I will show some different syntax.

Access Insert:
INSERT INTO `OwnerInfo` (`OwnerDescription`, `Name`, `Address1`, `Address2`, `City`, `State`, `AmtDue`, `Credit`, `Phone`, `Zip`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

SQL Server Insert (no 'Provider'):
INSERT INTO [dbo].[OwnerInfo] ([OwnerDescription], [Name], [Address1], [Address2], [City], [State], [AmtDue], [Credit], [Phone], [Zip]) VALUES (@.OwnerDescription, @.Name, @.Address1, @.Address2, @.City, @.State, @.AmtDue, Credit, @.Phone, @.Zip);

Hybrid (error and requires 'Provider'):
INSERT INTO [dbo].[OwnerInfo] ([OwnerDescription], [Name], [Address1], [Address2], [City], [State], [AmtDue], [Credit], [Phone], [Zip]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

My question is what 'Provider' should i use so that all of my SQL is the same? Both programs are inserting data into the exact same server into the exact same table. Is the 'Provider' even the source of the SQL difference? I am trying to get a standard set so that it will be easy to change/update in the future. One of the programs is completely finished (the one with no 'Provider' - SQL Server Insert example) and would like to finish changing the other one to match the same syntax as the previous. Any ideas?

Thursday, March 8, 2012

Access to SQL Server Express

Hi - is it possible to transfer an access database to SQL Server 2005
Express, while maintaining the primary/auto increment field numbers?
I've tried the upsizing wizard, and this didn't maintain indexes/keys,
I've also tried the new SQL Server Migration Assistant for Access CTP2 -
while this kept the column integrity intact, it appears to have
recreated the primary key, so where my autoincrement field in access may
have had:
1 toyota
2 citroen
3 vw
6 ford
8 audi
..after migration, the table is recreated as...
1 toyota
2 citroen
3 vw
4 ford
5 audi
..meaning the relationships between the tables are not maintained.
I have perhaps misunderstood what the migration tool is supposed to do,
but if anyone can help advise what tool will do what I'm looking for,
I'd appreciate it.
Thanks, Mark
*** Sent via Developersdex http://www.developersdex.com ***I haven't tried the ctp Migration Assistant, but there 'should' be an option
that allows the import of IDENTITY values.
--
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
"Mark" <anonymous@.devdex.com> wrote in message
news:u7YVVnOpGHA.2360@.TK2MSFTNGP05.phx.gbl...
> Hi - is it possible to transfer an access database to SQL Server 2005
> Express, while maintaining the primary/auto increment field numbers?
> I've tried the upsizing wizard, and this didn't maintain indexes/keys,
> I've also tried the new SQL Server Migration Assistant for Access CTP2 -
> while this kept the column integrity intact, it appears to have
> recreated the primary key, so where my autoincrement field in access may
> have had:
> 1 toyota
> 2 citroen
> 3 vw
> 6 ford
> 8 audi
> ..after migration, the table is recreated as...
> 1 toyota
> 2 citroen
> 3 vw
> 4 ford
> 5 audi
> ..meaning the relationships between the tables are not maintained.
> I have perhaps misunderstood what the migration tool is supposed to do,
> but if anyone can help advise what tool will do what I'm looking for,
> I'd appreciate it.
> Thanks, Mark
>
> *** Sent via Developersdex http://www.developersdex.com ***

Access to SQL Server Express

Hi - is it possible to transfer an access database to SQL Server 2005
Express, while maintaining the primary/auto increment field numbers?
I've tried the upsizing wizard, and this didn't maintain indexes/keys,
I've also tried the new SQL Server Migration Assistant for Access CTP2 -
while this kept the column integrity intact, it appears to have
recreated the primary key, so where my autoincrement field in access may
have had:
1 toyota
2 citroen
3 vw
6 ford
8 audi
..after migration, the table is recreated as...
1 toyota
2 citroen
3 vw
4 ford
5 audi
..meaning the relationships between the tables are not maintained.
I have perhaps misunderstood what the migration tool is supposed to do,
but if anyone can help advise what tool will do what I'm looking for,
I'd appreciate it.
Thanks, Mark
*** Sent via Developersdex http://www.codecomments.com ***I haven't tried the ctp Migration Assistant, but there 'should' be an option
that allows the import of IDENTITY values.
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
"Mark" <anonymous@.devdex.com> wrote in message
news:u7YVVnOpGHA.2360@.TK2MSFTNGP05.phx.gbl...
> Hi - is it possible to transfer an access database to SQL Server 2005
> Express, while maintaining the primary/auto increment field numbers?
> I've tried the upsizing wizard, and this didn't maintain indexes/keys,
> I've also tried the new SQL Server Migration Assistant for Access CTP2 -
> while this kept the column integrity intact, it appears to have
> recreated the primary key, so where my autoincrement field in access may
> have had:
> 1 toyota
> 2 citroen
> 3 vw
> 6 ford
> 8 audi
> ..after migration, the table is recreated as...
> 1 toyota
> 2 citroen
> 3 vw
> 4 ford
> 5 audi
> ..meaning the relationships between the tables are not maintained.
> I have perhaps misunderstood what the migration tool is supposed to do,
> but if anyone can help advise what tool will do what I'm looking for,
> I'd appreciate it.
> Thanks, Mark
>
> *** Sent via Developersdex http://www.codecomments.com ***

Access to SQL guidance?

OK I have been trying on my own to move from Access to SQL express/Developer. I have not found much in the way of guidence. Any suggestions? I would rank myself as fairly advanced with Access but just a newby to the SQL products... I keep blasting into walls and issues in the SQL world and would rather learn from someone elses' hardship rather than re-invent what has been undoubtably been already discovered.

I do fairly advanced reports and Large imports, Hence the need for developer rather than express, since the express import facility is hopelessly crippled. Even the developer SSIS is not well doccumented and seems pretty buggy and hard to use, even with the wizzards, As for reports.... well I'm expecting that to be a fairly had road to climb also...

Your are in a common position so rest assured many of us have been there. One of the easiest things I tend to do in this situation is learn as the need arises.

For example, creating relationships in access is very easy. You will find no such "GUI" way in sql server to create relationships. You can instead use management studio to do the same thing, but you just won't have the pretty layout that access has.

Also, if you are familiar with access you probably are aware of using an access project (intended I think for an SQL server type database situation).

So I would jump around this forum and other forums and find out the answers to the questions you need as these issues arise. You may want to pickup and intro to sql server book just to get an overview of the tools in sql server, but if you are the hands on type you may just want to jump right in. When you do install the dev edition you will (or may be -- I was) overwhelemd by the number of features installed. Keep it simple and focus on one task at a time.

E.g. create a simple db and run some queries and forget about configuring remote access and things like that at first.

I hope some of this was helpful. Do you have any specific questions about the change?

Ranginald|||

Thanks for the reply. Indeed that is exactly what I'm doing, jumping in that is. Its the way I've always learned the next new thing, in fact I've been involved with computers for more than 20 years now...Generally books are for sissies!

But on the other hand do you have any you would particularly single out as being good?

Here is some of my experience which may help the next person on this trail....I still don't get why someone has not addressed the topic more comprehensively since it seems that this is a path that many will be embarking on....

Actually I find the GUI table relationship thing to be fairly transferable to SQL management studio, so far. I miss being able to use vb in queries though...

so far I have a basic import going using ssis, (boy that wasn't easy) The SSIS tool seems very poorly supported, for instance I created an import job (via wizard), and just opened it and closed it with no modifications and it generated errors that it did not generate when first created by the wizard! Not to mention the terminations for truncated fields that there is no ready documentation how to accept rather than terminate.. So an import that took 5 minutes to do in Access took Hours to do in SSIS from a basic Flat text file.

I have imported a bunch of tables from access (easier)

I have done some derived tables and views, (not too hard) but I'm not to the advanced stuff yet.

Written one report, pretty basic and I'm thinking the SQL tool looks pretty hard relative to advanced reports in Access.

|||Glad I could help. I've always liked Wrox books. They are well written and to the point. I'm sure you know this already but whenever I want to buy a book I look on amazon for the user rating first to see if it's worth it.

Good luck.
Ranginald

Access to SQL Express connection string

I need to hardcode my TCP port to a SQL Server Express named instance. You guys have any examples I could see. I keep getting an error when I try to connect:

Run-time error 2147467259 BBNETLIB connection open parse connection paramaters, invalid connection. I'm trying to connect to a local instance on a Windows 2003 server.

Please post your connection string.|||

CONNECTION=Provider=SQLOLEDB;Data Source=SQCTLxp1\C1SQLEXPRESS;User ID=sa;Password=!!Gulpp1!!;Initial Catalog=@.DBNAME;

I removed the semicolon at the end of the connection string and it worked. Thank You.

Access to SQL Express connection string

I need to hardcode my TCP port to a SQL Server Express named instance. You guys have any examples I could see. I keep getting an error when I try to connect:

Run-time error 2147467259 BBNETLIB connection open parse connection paramaters, invalid connection. I'm trying to connect to a local instance on a Windows 2003 server.

Please post your connection string.|||

CONNECTION=Provider=SQLOLEDB;Data Source=SQCTLxp1\C1SQLEXPRESS;User ID=sa;Password=!!Gulpp1!!;Initial Catalog=@.DBNAME;

I removed the semicolon at the end of the connection string and it worked. Thank You.

Tuesday, March 6, 2012

Access SQLServer Express Using ADODB

Hi,

How should I do to access a table in SQLServer Express database using VB.NET and ADODB?

Thanks!

Hi Ciro,

I would recommend using the SqlConnection object in VB.Net as it gives you all the new hotness of SNAC rather than MDCA. SNAC supports both ODBC and OLEDB. Here is an example that I created almost completely using the Insert Snippet functionality in VS 2005. (i.e. You hardly need to know how to code these days.)

Code Snippet

Imports System.Data.SqlClient

Module Module1

Sub Main()

Dim conn As New SqlConnection()

conn.ConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorksLT;Persist Security Info=True;Integrated Security=True"

Dim cmd As New SqlCommand()

cmd.CommandType = CommandType.Text

cmd.CommandText = "SELECT * FROM SalesLT.Customer"

cmd.Connection = conn

Dim reader As SqlDataReader

Dim previousConnectionState As ConnectionState = conn.State

Try

If conn.State = ConnectionState.Closed Then

conn.Open()

End If

reader = cmd.ExecuteReader()

Using reader

While reader.Read

' Process SprocResults datareader here.

Console.WriteLine(reader.GetValue(3) & " " & reader.GetValue(5))

End While

End Using

Finally

If previousConnectionState = ConnectionState.Closed Then

conn.Close()

End If

End Try

End Sub

End Module

This gives you full access to all the SQL 2005 features.

If you just can't use SNAC, then the ADODB code for accessing SQL Express has not changed, just reference the ADODB library in your project and write standard ADODB code. You can find all kinds of sample connection strings at http://ConnectionStrings.com, where they suggest the following for OLEDB connections:

Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

One you have that you do the whole

Code Snippet

Dim conn As New ADODB.Connection

And you're on your way...

Mike

|||

Hi Mike,

Thank you for your reply.

I realy need to use ADODB, because in my project, I need a Recordset object.

I visited http://connectionstrings.com/ (it′s realy a nice site) and a I found the string connection:

"Driver={SQL Native Client};" & _

"Server=.\SQLExpress;" & _

"AttachDbFilename=c:\PathToMyDatabaseFile\MyDataBasefile.mdf;" & _

"Database=dbname;" & _

"Trusted_Connection=Yes;"

The first time that I run the code, it worked nice, but when I tried again, I received the follow error message:

[Microsoft][SQL Native Client][SQL Server]Cannot open database "dbname" requested by the login. The login failed.

I tried to remove "Database=dbname;" but it didn′t work too:

"[Microsoft][SQL Native Client][SQL Server]Cannot open user default database. Login failed."

VB.NET and SQLServer Express are a new word to me, and I don′t have any idea about how to solve this problem.

|||

I tried new experiments:

Now, I tried to access the database file using VB6 and VB.Net at the some time.

The first access worked properly, but for second one, I received the following message:

[Microsoft][SQL Native Client][SQL Server]Unable to open the physical file "C:\MyFilePath\MyFileName.mdf". Operating system error 32 (The file has been used in another process"

As I said before, SQLSERVER EXPRESS is a new world fo me, and I don't have any idea about how to solve this problem.

Thanks for any kind of help.

|||

Hi Ciero,

First off, you mentioned that you really need to use ADODB, but then you indicated that you're using the SQL Native Client anyway, which is different. Anyway...

You're getting messed up because you're using both AttachDbFilename and Database and things are getting mixed up in the translation. You should probably use only one of these:

Use AttachDbFilename if you are using a user instance by placing your database file directly in your project and letting VB.NET create the connection string for you. Use Database is you are working with a database that is already created in your SQL Express instance and you're just connecting to it.|||Thank you, Mike!

Friday, February 24, 2012

Access Project 2002 compatibility with SQL Server Express

Hi,

When using an Access Project 2002 connected with SQL Server Express in OLE DB it's impossible to work in creation mode. A message explains that this Access version is not compatible with this SQL version.

Is there a service pack ?

Unfortunately, no. By now Access Project cannot be used in design mode of SQL Express. Do note that the next verson of ms-access will fix this.

Sunday, February 19, 2012

Access my SQL 2005 Express Database using http/https

Hi!

I'm new using MSSql 2005 Express. How can i access my DB using http/https for reporting and DB changes/administration?

Regards,

JP

SQL Server Reporting Services is available through the exposed websites and the appropiate ports. THere is no https support for administration. You will need direct port access to the specified port (by default 1433) for administration of SQL Server.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Monday, February 13, 2012

access front end to sql server express backend

I would like to make an access frontend linked to my sqlserver express db. Is this possible?http://techrepublic.com.com/5208-6230-0.html?forumID=102&threadID=205509&messageID=2136367|||

Yes, quite possible.

You can either (a) use an Access Data Project file (adp), or (b) use 'Linked Tables' from a normal Access mdb file.

Thursday, February 9, 2012

access denied to RSReportServer.config

Hi,

I've just installed the new SQLSRV 2005 Express Adv Ed (ASP.NET 2.0.50727) and also installed the reporting services. Trying to browse the ReportServer website (via inetmgr or //localhost/ReportServer/) returns the following error (using Windows Credentials):

>>The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError)

Access to the path 'c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\RSReportServer.config' is denied.

<<

How can this be fixed? All hints appreciated. Thanks

Did you make this work? Got the same problem... Any help appreciated

Tomsi

|||Check the user account with which the service and website are running under. That will be the user that needs physical access to that location (NTFS permissions).

access denied to RSReportServer.config

Hi,

I've just installed the new SQLSRV 2005 Express Adv Ed (ASP.NET 2.0.50727) and also installed the reporting services. Trying to browse the ReportServer website (via inetmgr or //localhost/ReportServer/) returns the following error (using Windows Credentials):

>>The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError)

Access to the path 'c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\RSReportServer.config' is denied.

<<

How can this be fixed? All hints appreciated. Thanks

Did you make this work? Got the same problem... Any help appreciated

Tomsi

|||Check the user account with which the service and website are running under. That will be the user that needs physical access to that location (NTFS permissions).