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
  1. Home
  2. General Programming
  3. Visual Basic
  4. DataControl ---> Data "object" HowTo???

DataControl ---> Data "object" HowTo???

Scheduled Pinned Locked Moved Visual Basic
c++comjsonquestion
3 Posts 3 Posters 1 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.
  • T Offline
    T Offline
    Tim Rymer
    wrote on last edited by
    #1

    I have a data control and I need to pass in a Data object in a function's parameter. I'm the one making the function, so I can change it to a recordset, which is "ok" but it just doesnt make a whole lot of sense to do 1/2 of what i want to do outside of a function, and the rest inside of a function! (if i would pass a recordset) So any suggestions? my boss remembers doing it but he forgot how. (uhh huh, yeah ok) I believe it can be done, but all i want is a Data object, because that's the only thing i've really messed with in messing with Databases (i'm pretty new to VB but a veteran to C++) Ok, thanks in advance! ~Timothy T. Rymer http://tim.xpertz.com http://www.digipen.edu http://www.ttrx.com

    C B 2 Replies Last reply
    0
    • T Tim Rymer

      I have a data control and I need to pass in a Data object in a function's parameter. I'm the one making the function, so I can change it to a recordset, which is "ok" but it just doesnt make a whole lot of sense to do 1/2 of what i want to do outside of a function, and the rest inside of a function! (if i would pass a recordset) So any suggestions? my boss remembers doing it but he forgot how. (uhh huh, yeah ok) I believe it can be done, but all i want is a Data object, because that's the only thing i've really messed with in messing with Databases (i'm pretty new to VB but a veteran to C++) Ok, thanks in advance! ~Timothy T. Rymer http://tim.xpertz.com http://www.digipen.edu http://www.ttrx.com

      C Offline
      C Offline
      chris foote
      wrote on last edited by
      #2

      I'm not sure if this is what you are looking for.... You might what to do a search for "Data aware class" on the MSDN. Private Sub mysub(Data As Object) End Sub

      1 Reply Last reply
      0
      • T Tim Rymer

        I have a data control and I need to pass in a Data object in a function's parameter. I'm the one making the function, so I can change it to a recordset, which is "ok" but it just doesnt make a whole lot of sense to do 1/2 of what i want to do outside of a function, and the rest inside of a function! (if i would pass a recordset) So any suggestions? my boss remembers doing it but he forgot how. (uhh huh, yeah ok) I believe it can be done, but all i want is a Data object, because that's the only thing i've really messed with in messing with Databases (i'm pretty new to VB but a veteran to C++) Ok, thanks in advance! ~Timothy T. Rymer http://tim.xpertz.com http://www.digipen.edu http://www.ttrx.com

        B Offline
        B Offline
        bjwoodburn
        wrote on last edited by
        #3

        You are better off passing the recordset object if thats what you are going to be playing with. Otherwise you are using late binding. Something like this : Sub DrawData(ByVal oRec as ADODB.Recordset) Dim dField as Field For Each dField in oRec.Fields MsgBox dField.Value & " " & dField.Name Next End Function Sub Main() Dim oRecord as ADODB.RecordSet Dim ssql as String Dim oConnect As ADODB.Connection oConnect.Open "Blah,Blah" ssql = "SELECT * FROM table1" oRecord.Open ssql, oConnect, adOpenForwardOnly, adLockReadOnly DrawData(oRecord) MsgBox "Success" End Sub

        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