Results 1 to 4 of 4
  1. #1

    Default Need help in MSACCESS using VB6


    Maayong adlaw, mangayo unta ko tambag on how I could insert data (gikan sa text file) on a MS Access table using VB6? So far mao ni code akoa gigamit but dili jud makuha...kabalo nako maka-import ug comma-delimited or space de-limited text file...ang ako source text file kay log file from Reflection...

    Private Sub WriteData()
    Dim Con As ADODB.Connection
    Dim RecSet As ADODB.Recordset
    Dim strBSC, strBTS, strEUM As String


    Set Con = New ADODB.Connection
    Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=F:\XOpt\XOptDB.mdb;"

    Set RecSet = New ADODB.Recordset
    RecSet.LockType = adLockOptimistic
    RecSet.Open "tbl_ZEQOTest", Con

    If strBSCName <> "" Then
    Do
    'RecSet.Fields("BSCName") = strBSCName
    RecSet.Fields("BSCName").Value = strBSCName
    'RecSet.AddNew("BSCName", strBSCName) = strBSCName
    'RecSet.Fields.Update
    Loop Until RecSet.EOF
    End If


    RecSet.Close
    Set RecSet = Nothing

    Con.Close
    Set Con = Nothing


    End Sub

    Thanks kaayo daan...Happy New Year

  2. #2

    Default Need help in MSACCESS using VB6

    do you mean "text file" to "msaccess" using vb6?

  3. #3
    Quote Originally Posted by Kazekage View Post
    Maayong adlaw, mangayo unta ko tambag on how I could insert data (gikan sa text file) on a MS Access table using VB6? So far mao ni code akoa gigamit but dili jud makuha...kabalo nako maka-import ug comma-delimited or space de-limited text file...ang ako source text file kay log file from Reflection...

    Private Sub WriteData()
    Dim Con As ADODB.Connection
    Dim RecSet As ADODB.Recordset
    Dim strBSC, strBTS, strEUM As String


    Set Con = New ADODB.Connection
    Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=F:\XOpt\XOptDB.mdb;"

    Set RecSet = New ADODB.Recordset
    RecSet.LockType = adLockOptimistic
    RecSet.Open "tbl_ZEQOTest", Con

    If strBSCName <> "" Then
    Do
    'RecSet.Fields("BSCName") = strBSCName
    RecSet.Fields("BSCName").Value = strBSCName
    'RecSet.AddNew("BSCName", strBSCName) = strBSCName
    'RecSet.Fields.Update
    Loop Until RecSet.EOF
    End If


    RecSet.Close
    Set RecSet = Nothing

    Con.Close
    Set Con = Nothing


    End Sub

    Thanks kaayo daan...Happy New Year
    Try this, replace the Bold statement with this one:

    RecSet.Open "SELECT * FROM tbl_ZEQOTest", Con

    and also place this code RecSet.AddNew("BSCName", strBSCName) = strBSCName
    after the Do

    why dont you use the INSERT INTO sql command instead?, you are using ADODB.


    recset.open "INSERT INTO tbl_ZEQOTest VALUES('" & strBSCName & "')",con

  4. #4
    Thanks kaayo collectingsouls, ako ni i-try once naa na ko time .... thanks kaayo

  5.    Advertisement

Similar Threads

 
  1. need help in using facetime for mac to iphone
    By king1 in forum Gizmos & Gadgets (Old)
    Replies: 0
    Last Post: 11-01-2010, 01:00 PM
  2. Need help in VB6
    By nirdle_phogi in forum Programming
    Replies: 5
    Last Post: 03-13-2007, 12:45 AM
  3. need help in unlocking P900
    By jpk in forum Gizmos & Gadgets (Old)
    Replies: 2
    Last Post: 09-22-2006, 07:32 AM
  4. need help in going to Aparri.
    By mnpesiao in forum Destinations
    Replies: 4
    Last Post: 05-21-2006, 11:16 AM
  5. Want to buy a new mp3 player. Need help in selecting one.
    By metdumangas in forum Gizmos & Gadgets (Old)
    Replies: 21
    Last Post: 01-04-2006, 09:01 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
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top