Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[TUT] VB6 MSAccess Sample using ADO (UPDATED V3 20100216) now with ADD and DataReport

Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir, gumagamit po ba kayo ng SKINS sa VB programs nyu?.. para po sana astig tingnan..

gawin mo munang functional ang design at code at features bago mo paastigin.
madali lang ang skins pero sa field ko an astig ay di sa skin tinitignan, ang astig sa amin ay yung nakakasolve ng problem, basta maayos at basic ang GUI ok na sa amin.

saka mabagal pag may skin, added load sa processor.
mas ok sakin yung simple pero working at walang bugs kesa flashy pero kulang naman.

MSWord version 1 at 2 walang skins pero sumikat dahil functional sya at madaling gamitin.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

gawin mo munang functional ang design at code at features bago mo paastigin.
madali lang ang skins pero sa field ko an astig ay di sa skin tinitignan, ang astig sa amin ay yung nakakasolve ng problem, basta maayos at basic ang GUI ok na sa amin.

saka mabagal pag may skin, added load sa processor.
mas ok sakin yung simple pero working at walang bugs kesa flashy pero kulang naman.

MSWord version 1 at 2 walang skins pero sumikat dahil functional sya at madaling gamitin.

haha.. dati ako priority ko design, pero ngayon ndi na.. :)
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir, pano po lalagyan ng password yung database?.. I mean yung MSAccess po.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir, pano po lalagyan ng password yung database?.. I mean yung MSAccess po.

Pre nasa menu lang ng MSAccess ang paglagay ng password sa data, take the effort to find it. Nandyan lang yan.

Then idagdag mo sa connection string mo yung username at pasword.

refer to www.connectionstrings.com kung papano.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir pa check po ng code ko. di ko magawa eh. nag Try kasi akong lagyan ng delete button yung sample program mo po.. eto , pero error
Code:
Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim myVar As Long



ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
    getCom = "delete from ProductsMaster where ProductCode='" & myVar & "'"
    Set rsADO = sConn.Execute(getCom)
    MsgBox "Name deleted!", vbInformation
    LV.ListItems.Clear
    ListProducts
End If


Question ko po eh yung "myVar", gawa gawa ko lang po yan. gusto ko sana ipoint yung Product code na selected sa Listview pero di ko alam kung pano eh..
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir pa check po ng code ko. di ko magawa eh. nag Try kasi akong lagyan ng delete button yung sample program mo po.. eto , pero error
Code:
Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim myVar As Long



ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
    getCom = "delete from ProductsMaster where ProductCode='" & myVar & "'"
    Set rsADO = sConn.Execute(getCom)
    MsgBox "Name deleted!", vbInformation
    LV.ListItems.Clear
    ListProducts
End If


Question ko po eh yung "myVar", gawa gawa ko lang po yan. gusto ko sana ipoint yung Product code na selected sa Listview pero di ko alam kung pano eh..


Ano bang KEY ang ginamit mo sa records?

Kung pinag aralan mo yung Sample ko, nilagay ko sa tag yung product id sa bawat line, so pag nag select ako, makukuha ko yung ID ng item

Listview1.SelectedItem.Tag = yung product ID

So pag ngdelete ako, gagamitin ko yung product ID w/c is unique para i delete yung item.
Similar lang yan dun sa UPDATE function ng sample.

Ano ba yang names ng variable mo, sana gawin mong deescriptive para madali maintindihan ng ibang babasa.

So ganito, kunin mo nuna yung key from the SELECTED, use it to call delete query
 
Last edited:
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

thanks boss,

eto lang pala problem ko,
Code:
Listview1.SelectedItem.Tag = yung product ID


follow po ulit for further questions.. tnx =)
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

SIR...noob po ako sa VB6.pero mejo familiar na rin ako dahil eto ung ginamit ko nung thesis ko nung college(networking and hardware po kasi forte ko kaya mejo noobs sa programming)....meron po ba kau sample ng vb6 program connecting to ms access database na ung connection string is defined at RUN TIME?...un po bang may option ung program mo kung sang path kukunin ung database...pinapagawa lang sakin ng boss ko eh..hehe...lam nya kasi may background ako sa programming...btw,fresh grad po ako..working as a technical engineer....ym ko po sir: [email protected] po sir
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

SIR...noob po ako sa VB6.pero mejo familiar na rin ako dahil eto ung ginamit ko nung thesis ko nung college(networking and hardware po kasi forte ko kaya mejo noobs sa programming)....meron po ba kau sample ng vb6 program connecting to ms access database na ung connection string is defined at RUN TIME?...un po bang may option ung program mo kung sang path kukunin ung database...pinapagawa lang sakin ng boss ko eh..hehe...lam nya kasi may background ako sa programming...btw,fresh grad po ako..working as a technical engineer....ym ko po sir: [email protected] po sir

hello sir. yung sample po sa first page ay vb6 to access a po yun.. :thanks:

http://connectionstrings.com/
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir, what if check box yung pag delete para if gusto mag delete ng maramihan .. eto code ko
Code:
Private Sub cmdDelete_Click()
    Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim sTemp As String
[COLOR="Red"]    Dim x As Long[/COLOR]

   If ListView1.ListItems.Count <> 0 And Not (ListView1.SelectedItem Is Nothing) Then
        sTemp = ListView1.SelectedItem.Tag 
ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
    getCom = "delete from ProductsMaster where ProductCode='" & sTemp & "'"
[COLOR="Red"]       For x = ListView1.ListItems.Count - 1 To 0 Step -1[/COLOR]
    
       [COLOR="Red"] If ListView1.ListItems(x).Checked = True Then[/COLOR]
        Set rsADO = sConn.Execute(getCom)
        [COLOR="Red"] ListView1.ListItems.Remove(x)[/COLOR]
        [COLOR="Red"]End If[/COLOR]
[COLOR="Red"]    Next x[/COLOR]

    MsgBox "Name deleted!", vbInformation
    ListView1.ListItems.Clear
    ListProducts
End If
End If
End Sub
yung mga naka highlight ng red po, gumagana po pag inalis yan. pero walang check box. hehe




eto po error, index out of bounds. pasenxa na po, pero di ko talaga makuha eh, mahigit dalawang oras ko ng tinitigan. hehe, nahihiya na ko'ng matanong ng simpleng bagay :pray:
Code:
If ListView1.ListItems(x).Checked = True Then


edit: topic solve.. hehe

eto pala tama

Code:
 With LV
       For x = .ListItems.Count To 1 Step -1
        If .ListItems(x).Checked = True Then
        Set rsADO = sConn.Execute(getCom)
         LV.ListItems.Remove x
        End If
    Next
    End With
 
Last edited:
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

SIR...noob po ako sa VB6.pero mejo familiar na rin ako dahil eto ung ginamit ko nung thesis ko nung college(networking and hardware po kasi forte ko kaya mejo noobs sa programming)....meron po ba kau sample ng vb6 program connecting to ms access database na ung connection string is defined at RUN TIME?...un po bang may option ung program mo kung sang path kukunin ung database...pinapagawa lang sakin ng boss ko eh..hehe...lam nya kasi may background ako sa programming...btw,fresh grad po ako..working as a technical engineer....ym ko po sir: [email protected] po sir


Just browse for the database at runtime, then update mo yung connection string.

Pero usually di ganyan nag practice sa totoong buhay. Kasi wala ka guarantee na tama yung i open mo na database. So madami ka error handling dyan dapat.
Unless na databse utility yan similar sa MSAccess.

Monitor your post nalang, dont expect an email, you can contact any SB member via YM but not the other way around.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir pa help naman po..
nagawa ko na yung multiple delete using check box.. pati yung 1 item delete na highlight lang yung item para idelete.

eto po kasi nadiscover ko'ng problem,

pag nagdelete yung user, example 2 items using check box. pero yung cursor nya, naka highlight sa isa pang item ,which is di naman nya dapat idelete. Pag click na po yung button, 3 items po yung nadedelete eh, kasama yung nakahighlight..

eto po code ko sa delete button.
Code:
Private Sub cmdDelete_Click()
    
    
    
    Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim sTemp As String
    Dim x As Long

ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
  
     With ListView1
       For x = .ListItems.Count To 1 Step -1
        If .ListItems(x).Checked = True Then
          getCom = "delete from ProductsMaster where ProductCode='" & ListView1.ListItems(x) & "'"
        Set rsADO = sConn.Execute(getCom)
         ListView1.ListItems.Remove x
        
        Else
            
            If ListView1.ListItems.Count <> 0 And Not (ListView1.SelectedItem Is Nothing) Then
        sTemp = ListView1.SelectedItem.Tag  
          getCom = "delete from ProductsMaster where ProductCode='" & sTemp & "'"
        Set rsADO = sConn.Execute(getCom)
       
            End If
        End If
    Next
    End With

    MsgBox "One or more Item deleted!", vbInformation, "Delete"
    ListView1.ListItems.Clear
    ListProducts
End If

End Sub
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir pa help naman po..
nagawa ko na yung multiple delete using check box.. pati yung 1 item delete na highlight lang yung item para idelete.

eto po kasi nadiscover ko'ng problem,

pag nagdelete yung user, example 2 items using check box. pero yung cursor nya, naka highlight sa isa pang item ,which is di naman nya dapat idelete. Pag click na po yung button, 3 items po yung nadedelete eh, kasama yung nakahighlight..

eto po code ko sa delete button.
Code:
Private Sub cmdDelete_Click()
    
    
    
    Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim sTemp As String
    Dim x As Long

ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
  
     With ListView1
       For x = .ListItems.Count To 1 Step -1
        If .ListItems(x).Checked = True Then
          getCom = "delete from ProductsMaster where ProductCode='" & ListView1.ListItems(x) & "'"
        Set rsADO = sConn.Execute(getCom)
         ListView1.ListItems.Remove x
        
        Else
            
            If ListView1.ListItems.Count <> 0 And Not (ListView1.SelectedItem Is Nothing) Then
        sTemp = ListView1.SelectedItem.Tag  
          getCom = "delete from ProductsMaster where ProductCode='" & sTemp & "'"
        Set rsADO = sConn.Execute(getCom)
       
            End If
        End If
    Next
    End With

    MsgBox "One or more Item deleted!", vbInformation, "Delete"
    ListView1.ListItems.Clear
    ListProducts
End If

End Sub

:hello: sir..

regarding sa problem mo, try mo po hanapin sa properties ng ListView yung "HoverSelection" & "HotTracking" and change its value to FALSE.. para kapag nakahover yung mouse sa isang item e hindi ito maseselect..
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

naka false naman po eh..

Sir, another question..
may instance po ba na di gumagana ang "Unload me" na command.
may na encounter po kasi ako na di gumagana yung unload me eh, as in unclickable yung button.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Sir pa help naman po..
nagawa ko na yung multiple delete using check box.. pati yung 1 item delete na highlight lang yung item para idelete.

eto po kasi nadiscover ko'ng problem,

pag nagdelete yung user, example 2 items using check box. pero yung cursor nya, naka highlight sa isa pang item ,which is di naman nya dapat idelete. Pag click na po yung button, 3 items po yung nadedelete eh, kasama yung nakahighlight..

eto po code ko sa delete button.
Code:
Private Sub cmdDelete_Click()
    
    
    
    Dim sConn As New ADODB.Connection
    sConn.Open gstrConnectionString
    Dim rsADO As New ADODB.Recordset
    Dim ans As Integer
    Dim getCom As String
    Dim sTemp As String
    Dim x As Long

ans = MsgBox("Are you sure you want to delete?", vbYesNo + vbCritical)
If ans = vbYes Then
  
     With ListView1
       For x = .ListItems.Count To 1 Step -1
        If .ListItems(x).Checked = True Then
          getCom = "delete from ProductsMaster where ProductCode='" & ListView1.ListItems(x) & "'"
        Set rsADO = sConn.Execute(getCom)
         ListView1.ListItems.Remove x
        
        Else
            
            If ListView1.ListItems.Count <> 0 And Not (ListView1.SelectedItem Is Nothing) Then
        sTemp = ListView1.SelectedItem.Tag  
          getCom = "delete from ProductsMaster where ProductCode='" & sTemp & "'"
        Set rsADO = sConn.Execute(getCom)
       
            End If
        End If
    Next
    End With

    MsgBox "One or more Item deleted!", vbInformation, "Delete"
    ListView1.ListItems.Clear
    ListProducts
End If

End Sub

Common mistake.

Remember yung ListView1.ListItems(x), yung X nagbabago kasi nag reremove ka ng index.

Lets say inalis mo yung Item1, so yung Item2 ngayon magiging Item1, yung item3 dati magiging item2, gets mo?

Pinakasimpleng approach kung madami ka i delete is i delete mo lahat ng naka check from the database, hwag mo muna alisin sa listview, then after madelete lahat, i refresh mo nalang yung listview.

O kaya ayusin mo yung For Next Loop mo, hanapin mo yung first na nakacheck then delete, then ulit na naman.
Hangang maubos ang naka check.

No code sample, figure it out kung papano, magandang challenge yan.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

I'll just finish my OJT sir and I will devote my time in learning with you. Thank you for this sir!

BTW my Y!M is "laurencepanganiban" without the quote. I'd be glad to add you sir, all because I am really willing to learn.

Thanks! See yah soon.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

I'll just finish my OJT sir and I will devote my time in learning with you. Thank you for this sir!

BTW my Y!M is "laurencepanganiban" without the quote. I'd be glad to add you sir, all because I am really willing to learn.

Thanks! See yah soon.

Ikaw mag add sa member na gusto mong kausapin.
Ill answer your questions if i can.
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

bro paano po ba insert ng pic using DAO... sabay po sa pag entry nag mga fields... salamat po boss
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

sir ask ko lang... kasi alang microsoft activex data object 2.8 or 6.0 dito sa pc sa lab namin eh yung ginawa kong database working with 2.8 and 6.0 version...
 
Re: [TUT] VB6 MSAccess Sample using ADO (UPDATED V2 20091212) now with LogIn Form

Bossing pahingi naman po ung may ADD na command please..Mail me naman po [email protected]
 
Back
Top Bottom