Results 1 to 3 of 3
  1. #1
    Thenaar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    2

    Access Security in VB.NET

    Hello,



    I have 2 database : an old one filled with informations, and a new one (empty) with a different structure.
    I want to fill the second one with the information from the first one. I use Access 2010 and I'm doing that with vb.net.

    Loading the first base is not a problem, I manage to insert several rows into the second one, but after like 10 inserts I got this error : Uspecified error


    Click image for larger version. 

Name:	ErreurAccess2.png 
Views:	10 
Size:	10.9 KB 
ID:	28630

    I noticed that the laccdb file of the destination database is getting bigger, when it's 4ko, the error occur.

    Here is the function I use to connect :


    Code:
    Public Shared Function Request2(ByVal req AsString)As OleDbDataReader
    
            Dim conn As New System.Data.OleDb.OleDbConnection()
            conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=...."
            Dim maCommande As OleDbCommand
            Dim custReader As OleDbDataReader
            conn.Close()
    
            Try
                conn.Open()
                maCommande = New OleDbCommand(req, conn)
                custReader = maCommande.ExecuteReader(CommandBehavior.CloseConnection)
                Return custReader
            Catch ex As Exception
                MessageBox.Show("Error in the RequestAccess() function : " & ex.Message)
            End Try
     
            Return Nothing
    EndFunction
    I tried to put the con.close() in a Finally statement but then I had no data in the reader returned, so I put it at the beggining hoping I close the previous one, but I'm not sure it works.

    Sorry for the mistakes I'm not fluent

    Regards

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You don't need any code to do this.
    simply open 1 db and transfer all data to it.

  3. #3
    Thenaar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    2
    Hello ranman256,

    Of course I could even copy/paste the database, it would be way easier, but I changed the structure of the database, so I need to load the first one and then reorder everything to insert on the second database.

    Regards

Please reply to this thread with any new information or opinions.

Similar Threads

  1. access security
    By ariansman in forum Access
    Replies: 22
    Last Post: 04-30-2015, 12:48 PM
  2. Replies: 2
    Last Post: 01-16-2015, 06:43 PM
  3. access on server security
    By bigmac in forum Security
    Replies: 1
    Last Post: 03-11-2012, 06:02 AM
  4. Security Access
    By aaragon in forum Access
    Replies: 1
    Last Post: 09-07-2011, 01:52 AM
  5. Access Security
    By Clinton in forum Access
    Replies: 5
    Last Post: 01-06-2011, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums