Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Data1.DatabaseName = from network server

Data1.DatabaseName = from network server

Scheduled Pinned Locked Moved Visual Basic
databasesysadminsecurityhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    loid grey manuel
    wrote on last edited by
    #1

    i have problem with data1, i am trying to network a project of mine in VB6.. the scenario is this, i have an MS Flexgrid and i want to fill it with data from a Data1. the problem is that the ms access DB is located at the Local Server from our network at office. i was able to manage at least to connect the DB using the code below

    Option Explicit
    Dim cn As ADODB.Connection
    Dim rs As ADODB.Recordset

    Private Sub Form_Load()
    Dim cn As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim strsql As String

    '-- get db path
    Set cn = New ADODB.Connection
    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb ;Persist Security Info = False"

     cn.Open
     Set rs = cn.Execute("select \* from dataTable")
    

    End Sub

    but i can't figure out how set the database name for data1

    Data1.DatabaseName = "WHAT Should be the Path?" 
    Data1.RecordSource = ("select \* dataTable order by Title")
    

    how am i going to access the database and save it's content's to data1? thanks in advance.

    D 1 Reply Last reply
    0
    • L loid grey manuel

      i have problem with data1, i am trying to network a project of mine in VB6.. the scenario is this, i have an MS Flexgrid and i want to fill it with data from a Data1. the problem is that the ms access DB is located at the Local Server from our network at office. i was able to manage at least to connect the DB using the code below

      Option Explicit
      Dim cn As ADODB.Connection
      Dim rs As ADODB.Recordset

      Private Sub Form_Load()
      Dim cn As ADODB.Connection
      Dim rs As ADODB.Recordset
      Dim strsql As String

      '-- get db path
      Set cn = New ADODB.Connection
      cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb ;Persist Security Info = False"

       cn.Open
       Set rs = cn.Execute("select \* from dataTable")
      

      End Sub

      but i can't figure out how set the database name for data1

      Data1.DatabaseName = "WHAT Should be the Path?" 
      Data1.RecordSource = ("select \* dataTable order by Title")
      

      how am i going to access the database and save it's content's to data1? thanks in advance.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      DatabaseName was the fully qualified path to your database. In your case, it's exactly the same as your Data Source value in your connection string.

      \\\\IP Address or Computer Name\\DIR\\masterFile.mdb
      

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        DatabaseName was the fully qualified path to your database. In your case, it's exactly the same as your Data Source value in your connection string.

        \\\\IP Address or Computer Name\\DIR\\masterFile.mdb
        

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        L Offline
        L Offline
        loid grey manuel
        wrote on last edited by
        #3

        got my database running over LAN. thanks for the tips...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups