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!

Exclusively for Visual Basic 6.0 Programmers Only!

d po ba pwedeng sa form load ko iconnect ung db?

depende sa needs at style mo,

ako kasi mag-connect sa database everytime na kelangan ko lang basahin then disconnect na, tipid sa memory yun,
walang static connection habang nag run ang exe.
once na naka cache na ang connection, mabils na.
saka bakit ka naka connect kung wala ka naman ginagawa sa database.

ang concept na yan ay similar sa connection mo sa web server, connect then once na nakuha na yung data ay putol na ang connection.

mas di loaded ang server mo kasi wala rin sya hinahawakan na connection for a long time.

isipin mo kung may 100 users ka, maghapon naka on ang program mo, e di sa server may 100 connections ka,
sa clients naman connected yan at nasa memory habang naka up ang program mo.

while kung open/close ang connection, saglit lang na nasa memory ang connection, one nakuha ang data ay close agad,
always zero ang naka static connections sa server.
maiiwasan pa ang hung ng server or client.

matagal ko na ginagamit ang ganyan na concept sa ADODB, mahirap mong magagawa yan pag gumagamit ka ng data control.

anyway im programming for maximizing code efficiency for production class applications, so habol namin ang stability ng system.

nasa sayo pa rin yan
 
sir i have successfully connected my project with mysql using RDO

but my problem is ung pag display ng result sa isang textbox,

in general, i have problems in querying my database

pakicheck naman po ung project ko if u dont mind sir:pray:

ung may connection sa database ehh ung frmcriminalrecords

naka global po ung rdoConnection and rdoQuery declaration

tapos ung pagconnect nasa form load po

please po pakicheck kung bakit ayaw magquery tnx:pray:

inattach ko na rin po ung database nya, salamat:pray:
 

Attachments

  • dbpcais1.sql.zip
    547 bytes · Views: 7
  • project.rar
    138.3 KB · Views: 18
ok na pala ung add, delete, update, and connect sir

and problema ko e magdisplay ng result using the SELECT query,

i want to display a field from my table sa text box help po pls
 
ok na pala ung add, delete, update, and connect sir

and problema ko e magdisplay ng result using the SELECT query,

i want to display a field from my table sa text box help po pls

Change

rdoQry.SQL = "Select name from tblcriminal_records where case_number=search_name;"


To this

rdoQry.SQL = "Select name from tblcriminal_records where case_number='" & search_name & "';"
 
Last edited:
hellow po mga kuya..
I just want to ask kung pwedeng gumawa ng program using VB na automatic xa yung pipindot ng keys... example... F9, F8, F7.. hehehetry ko kase gamitin sa laro pag nag du-dual computer gamit ko^^ kung meron man ano po yung syntax^^

thx po sa ma rereply^^
 
pano ko po sya ilalagay sa textbox? pede bang textbox.text = rdoQry.SQL?


Public cnMySql As New rdoConnection
Public rdoQry As New rdoQuery
Dim rdoRs As rdoResultset

Private Sub cmdsearch_Click()
Dim search_name As String
search_name = txtsearch.Text

rdoQry.SQL = "Select * from tblcriminal_records where case_number='" & search_name & "';"
Set rdoQry.ActiveConnection = cnMySql
rdoQry.Execute

Set rdoRs = rdoQry.OpenResultset
With rdoRs
Do Until .EOF
txtname.Text = !Name
txtaddress.Text = !Address
'etc...
.MoveNext
Loop
End With

End Sub
 
Last edited:
hellow po mga kuya..
I just want to ask kung pwedeng gumawa ng program using VB na automatic xa yung pipindot ng keys... example... F9, F8, F7.. hehehetry ko kase gamitin sa laro pag nag du-dual computer gamit ko^^ kung meron man ano po yung syntax^^

thx po sa ma rereply^^


use timer then set your desired interval

Private Sub Timer1_Timer()

SendKeys "{F7}"

SendKeys "{F8}"

SendKeys "{F9}"

End Sub
 
Last edited:
Public cnMySql As New rdoConnection
Public rdoQry As New rdoQuery
Dim rdoRs As rdoResultset

Private Sub cmdsearch_Click()
Dim search_name As String
search_name = txtsearch.Text

rdoQry.SQL = "Select * from tblcriminal_records where case_number='" & search_name & "';"
Set rdoQry.ActiveConnection = cnMySql
rdoQry.Execute

Set rdoRs = rdoQry.OpenResultset
With rdoRs
Do Until .EOF
txtname.Text = !Name
txtaddress.Text = !Address
'etc...
.MoveNext
Loop
End With

End Sub

anu po ung !Name sir? ung sa field po ba ng database?


run-time error 40041 po e
 
eto po ung new program na naedit ko na po

nadisplay ko na ung mga details kaya lang po may error kapag nagsearch ulit ako sa frmcriminalrecords

the property is read-only daw po ehh.

pahelp po please
 

Attachments

  • dbpcais.rar
    1.1 KB · Views: 4
  • project.rar
    96.7 KB · Views: 10
Last edited:
ok na pala po, matanong lang, paanu po magcreate ng table para dun ko ipakita ung databae ko?
 
sir eric. nakakita po ko ng sample dito ng Inventory na pinapaedit nyo.. hehehehe nagawa ko na po hehehe galing nyo talaga :-bd ung add po db walang code, hehehe salamat sir... success po ung thesis 1 namin.. thanks sa GR heheheh nice sir... :clap::clap::clap::praise::praise::praise::thumbsup::thumbsup::thumbsup:
 
ayt kainis!!

pagbabawas ng item!!!
ayaw mag update pag naclick na ung button ng send sa listview.

Function less()
On Error Resume Next
Set rs = New Recordset
With rs
If combo1 = "Soap" Then
TBl = "Select * from TblSoap where ProductCode ='" & txtPC & "'"
End If

If combo1 = "Lotion" Then
TBl = "Select * from TblLot where ProductCode ='" & txtPC & "'"
End If

.Open TBl, db, adOpenKeyset, adLockOptimistic
!RemainingQuantity = txtDiff.Text
.Update
.Close
End With
end function

kailangan ring i close at buksan uli ang system para makita ang pagbabago



ayaw lumabas ng natitirang quantity ng product
sa txtrq.text= !RemainingQuantiry


'code

Dim LC As String
If List1.ListCount > 0 Then
LC = List1.Text


set rs= new recordset
with rs

If Combo1.Text = "Lotion" Then
.Open "select * from TblLot where Description ='" & LC & "'", db, adOpenKeyset, adLockOptimistic


'If combo1.Text = "Lotion" Then
txtPC.Text = !ProductCode
txtPB.Text = !ProductBrand
txtDes.Text = !Description
txtUnit.Text = !UnitPrice
txtRQ.Text = !RemainingQuantity

End If
end with


pa help po
 
ayt kainis!!

pagbabawas ng item!!!
ayaw mag update pag naclick na ung button ng send sa listview.

Function less()
On Error Resume Next
Set rs = New Recordset
With rs
If combo1 = "Soap" Then
TBl = "Select * from TblSoap where ProductCode ='" & txtPC & "'"
End If

If combo1 = "Lotion" Then
TBl = "Select * from TblLot where ProductCode ='" & txtPC & "'"
End If

.Open TBl, db, adOpenKeyset, adLockOptimistic
!RemainingQuantity = txtDiff.Text
.Update
.Close
End With
end function

kailangan ring i close at buksan uli ang system para makita ang pagbabago



ayaw lumabas ng natitirang quantity ng product
sa txtrq.text= !RemainingQuantiry


'code

Dim LC As String
If List1.ListCount > 0 Then
LC = List1.Text


set rs= new recordset
with rs

If Combo1.Text = "Lotion" Then
.Open "select * from TblLot where Description ='" & LC & "'", db, adOpenKeyset, adLockOptimistic


'If combo1.Text = "Lotion" Then
txtPC.Text = !ProductCode
txtPB.Text = !ProductBrand
txtDes.Text = !Description
txtUnit.Text = !UnitPrice
txtRQ.Text = !RemainingQuantity

End If
end with


pa help po



put the code in the click event of Combo1
 
ung mga huling code na po eh nasa click event na po ng combo1
^_^..
 
Back
Top Bottom