Re: Saving Back-End Data As mdf




I posted an example of a connection string earlier. Here's an example of a
VB.NET console app that uses that connection string. This assumes that your
database is an MDB, not the new ACCDB format. There's an example of a
connection string for the new ACCDB format in my earlier post, but as I said
I believe that would require Office 2007 installed on the target PC and
probably will not work now that you have uninstalled Office 2007.

Module Module1

Sub Main()

Dim ConnectionString As String
Dim Connection As System.Data.OleDb.OleDbConnection
Dim Command As System.Data.OleDb.OleDbCommand
Dim Reader As System.Data.OleDb.OleDbDataReader

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\usenet\source.mdb;" & _
"Persist Security Info=False"
Connection = New System.Data.OleDb.OleDbConnection(ConnectionString)
Command = Connection.CreateCommand
Command.CommandText = "SELECT CategoryName FROM Categories " & _
"ORDER BY CategoryName"
Command.CommandType = CommandType.Text
Try
Connection.Open()
Reader = Command.ExecuteReader
Do While Reader.Read
Console.WriteLine(Reader(0).ToString)
Loop
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
If Not Reader Is Nothing Then
If Not Reader.IsClosed Then
Reader.Close()
End If
End If
If Not Connection Is Nothing Then
If Connection.State <> ConnectionState.Closed Then
Connection.Close()
End If
End If
Console.ReadLine()
End Try

End Sub

End Module

--
Brendan Reynolds
Access MVP

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eHXfKYGvGHA.4472@xxxxxxxxxxxxxxxxxxxxxxx
This is the what occurs when I try to make a new data connection.
I'm not quite sure what to use as the connection string.

'Format of the initialization string does not conform to
specification starting at 0.'

James

"Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:utuhVhFvGHA.4436@xxxxxxxxxxxxxxxxxxxxxxx

Yes, it was the error you were getting when trying to connect from the
VB.NET app to the MDB that I was talking about! :-)

I'm sorry, I'm afraid I don't have any suggestions about the Office
installation problem. There's probably a setup log created somewhere on
your PC that might give some indication of what the problem is, if you
can decipher it. But I've been lucky, I haven't had any installation
problems with Office 2007, so I haven't needed to look into that.

I've probably jinxed myself now, of course. Excuse me while I go find a
piece of wood to knock on! :-)

--
Brendan Reynolds
Access MVP


"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:OPV13AAvGHA.4888@xxxxxxxxxxxxxxxxxxxxxxx
Sorry wrong thread.

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:OJlEI6$uGHA.5056@xxxxxxxxxxxxxxxxxxxxxxx
Here's the error. This occurs after I make the selections in the
Custom install for Access 2007 and the Shared Office stuff
at the bottom. The rest I set to Not Available. Mind you, I have
tried to use just the Upgrade option and have tried installing all
so it doesn't appear to be a problem with how or what I install.

Error: 'Microsoft Office Professional Plus 2007 (Beta) setup did not
complete successfully. We are sorry
for the inconvenience.'

'An error occurred during installation and Microsoft Office
Professional Plus 2007 (Beta) setup was
unable to complete.'

Thanks,
James

"Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23Trz2K5uGHA.2448@xxxxxxxxxxxxxxxxxxxxxxx
It's up to you, of course, if you don't want to pursue this further,
but possibly someone might be able to help if you can tell us what the
error message was. (I gather you may have done that in another thread,
but I haven't seen it.)

--
Brendan Reynolds
Access MVP

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eO8upuzuGHA.1852@xxxxxxxxxxxxxxxxxxxxxxx
Same error message. Of course the Data Source is the path to the mdb.
I don't know.
I'll give up for now.

James

"Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23peV9etuGHA.976@xxxxxxxxxxxxxxxxxxxxxxx

My understanding is that if you use the new file format you will
need to use the new provider, with a connection string something
like so ...

Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=c:\usenet\test.accdb;Persist Security Info=False

... however, because this new provider is a component of Office
2007, and not a component of the operating system as the older JET
provider is, this requires Office 2007 to be installed on the target
PC, which is presumably why it won't work on your PC now that Office
2007 has been uninstalled.

If you stick with the older MDB format, you should be able to get to
it from .NET with the older JET provider, using a connection string
something like ...

Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\usenet\test.mdb;Persist Security Info=False

At the following URL ...

http://www.microsoft.com/office/preview/beta/getthebeta.mspx?showIntro=n

... under the heading 'IT Content for 2007 Office System Beta 2'
there is a reference to 'an authorization control that provides you
access to the Microsoft Office Online Beta site'. I can't say for
sure, but I would expect that access to the Beta site would probably
include access to the Beta newsgroups, and possibly you might get
more help with your installation issue there.

Good luck,

--
Brendan Reynolds
Access MVP

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:O92Xt%23suGHA.4460@xxxxxxxxxxxxxxxxxxxxxxx
Ok. Just trying different things.

Thanks
James

"Arvin Meyer [MVP]" <a@xxxxx> wrote in message
news:OILGKBpuGHA.4612@xxxxxxxxxxxxxxxxxxxxxxx
Yes it is beta software, and not really ready for production
databases. Not too many are using it at all, and those of us on
the beta, are not using it in production. It should therefore be
understandable that we can't (or don't) answer questions on Access
2007.

Try a stable release, such as XP (2002) or 2003, and you will be
able to do what you need to do. I also suggest that you keep the
databases in the default Access 2000 file format. That way you
will be able to share it with a wider range of users.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:ucUNe9luGHA.5084@xxxxxxxxxxxxxxxxxxxxxxx
Why? Ready? Here goes.
It all started when I attempted to evaluate Access 2007 Beta.
I needed to uninstall the Office 2007 Beta 2 times. The third
time I tried to install it the install failed. So I'm
unable to evaluate Access 2007 Beta. I've posted and posted to
these newsgroups and no one has replied.
I understand it's a beta but if I can't install it I can't
evaluate it.
So, I decided to try Visual Basic 2005 Express Edition. Now a
problem with that. I get an error when I try to
connect to my Access back-end db. Again, I posted and posted...
nothing.
I was hoping I would have better luck if I would save the mdb
as a mdf file for Visual Basic 2005 Express Edition.
Any way I'm a bit frustrated now.
It's sort of funny I was able to connect to my Access
back-end db with Alpha 5!? Maybe I'll go with that.

James

"Arvin Meyer [MVP]" <a@xxxxx> wrote in message
news:OIBWNnbuGHA.5044@xxxxxxxxxxxxxxxxxxxxxxx
mdf files are the SQL-Server data files. You need to have an
instance of SQL-Server running in order to save anything to the
file. Once you do it is easy. Access forms can connect directly
to the data tables in SQL-Server. My question to you might be,
why use VB.NET if you alrady have a more efficient database
application front-end in Access?
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"JamesJ" <jjy@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uKF04hYuGHA.1852@xxxxxxxxxxxxxxxxxxxxxxx
Ho do I save or export my back-end data db as
a mdf so I might use it in Vb 2005.

Thanks,
James

























.



Relevant Pages

  • Re: Saving Back-End Data As mdf
    ... I'm not quite sure what to use as the connection string. ... so it doesn't appear to be a problem with how or what I install. ... My understanding is that if you use the new file format you will need ... access to the Microsoft Office Online Beta site'. ...
    (microsoft.public.access.formscoding)
  • Installer - Custom Textboxes in UI problem
    ... void Install function. ... I've tested it by writing the string out to a text file ... put the connection string and I intend to test the db connectivity and write ... throw new InstallException("The database conection information is not ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Saving Back-End Data As mdf
    ... Although at this time I'm unable to reinstall the Office 2007 Beta ... Having build and compiled the app, you could run it outside Visual ... I posted an example of a connection string earlier. ... so it doesn't appear to be a problem with how or what I install. ...
    (microsoft.public.access.formscoding)
  • Re: Saving Back-End Data As mdf
    ... complete code of a VB.NET console app. ... It's just an example to illustrate how a connection string is used. ... so it doesn't appear to be a problem with how or what I install. ... you access to the Microsoft Office Online Beta site'. ...
    (microsoft.public.access.formscoding)
  • Re: C++ support for ADO
    ... I've added them in the connection string because the database itself ... you may need to install the Jet components on the machine that is ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)

Loading