View: 7523|Reply: 22
|
microsoft access..tolong!!
[Copy link]
|
|
aku tengah wat sistem utk unit aku..sistem simple jek.. dan aku gunakan microsoft access..aku cadang nak wat sistem nih nampak best sket..so bagi sesapa yg ada tips berguna utk access tuh rajin2laa kongsi..
1st yg aku nak tanya, camna nak wat login dan password utk user...kat mana nak carik function nih...hanya org tertentu je yg leh masuk dlm access kita..
kat mana leh dapat tutorial tambahan utk access nih..tutorial selain yg basic2 tntg access nih...
kalo ada soklan lagi aku posting kat sini je... |
|
|
|
|
|
|
|
tader sapa nak respond ke..tolonglaa aku!! |
|
|
|
|
|
|
Reign This user has been deleted
|
maaf! aku tak tau guna access ni, kalau tak de respond, takde yang tau kot. |
|
|
|
|
|
|
|
ada yang tau cuma kena tunggu dululah.... maybe diorang tangah fikir |
|
|
|
|
|
|
|
sat aaa... nanti aku carik kat mana aku letak link utk blajo access ... |
|
|
|
|
|
|
|
emm aku try tolong yg mane aku bleh lah yek..
firstly ko kenalah ader table yg ko nak simpan name user tu..
pastu ko buat lah checking sama ada nama yg ko key in tu ader tak dalam table..
ade dua cara :
1.Coding tu kat button 'enter' atau..
2. Button enter tu memanggil module utk buat checking.
Coding dia lebih kurang mcm ginilah :
// ini kalu ko panggil module
Function CheckSecurity(txtUserName As String, txtPassword As String)
Dim rsttblSecurity As DAO.Recordset
Set rsttblSecurity = CurrentDb!tblpassword.OpenRecordset // tblpassword = table yg ader name user tu..
rsttblSecurity.MoveFirst
Do While Not rsttblSecurity.EOF
If rsttblSecurity!UserName = txtUserName Then
If rsttblSecurity!Password = txtPassword Then
stDocName = "frmMainMenu"
'stLinkCriteria = "[UserName]=" & "'" & Forms!frmPassword![txtUserName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Invalid Password!!!"
End If
End If
rsttblSecurity.MoveNext
Loop
rsttblSecurity.Close
End Function
cube try ek..:ah: |
|
|
|
|
|
|
|
:hmm: ehmm cuba tgk help ... atau ko pakai wizard ... atau ko amik sample dari northwind db tuh .. pas tuh ko manipulate laa ikut requirement unit ko tadi ... cangne ? :hmm: |
|
|
|
|
|
|
|
encek... tu skrip buat vb tu... ekekeke... ms access kalau nak buat validation untOk password ko kena buat file macro dia... ntah ler... aku pun dah lama tak pegang access... ekekeke... :lol |
|
|
|
|
|
|
|
Originally posted by cipOt_cedOt at 27-7-2004 09:21 AM:
encek... tu skrip buat vb tu... ekekeke... ms access kalau nak buat validation untOk password ko kena buat file macro dia... ntah ler... aku pun dah lama tak pegang access... ekekeke... :lol
ler..kan access tu adik beradik vb..
dlm acces tu adalah VBA sebenarnya..
memanglah ko bleh guna macro tapi kalu nak buat checking kene gune code VBA ni..
Sama gak ngan excell, disebalik excell yg biasa kita dok pakai tu ader coding vb sebenarnya |
|
|
|
|
|
|
seek1u This user has been deleted
|
yup agreed..
vba lah yg mengerakkan macro utuk semua ms office product termasuk access ,
excel , words dan power point..
vba mmg adik beradik ngan vb..tp tak sama..cth..cam ku ..leh buat vba utuk
excel..tp bila ko bagi access..aku kantoi..sama gak utk buat words etc..
tu yg susah sket vba ni..hehe.. |
|
|
|
|
|
|
seek1u This user has been deleted
|
sorry ni ff: actually..
tp cuma nak bagi perbandingan buat excel punya password form utntuk restrict
access certain user je..hanya contoh..maybe senah leh nampak sesuatu dari sini
tentang penggunaan vba dalam access pulak..hopefully
- Option Explicit
- Public SaveWB As Boolean
- Public CloseWB As Boolean
- Sub Close_WB()
- CloseWB = True
- SaveWB = True
- ThisWorkbook.Close
- ThisWorkbook.Save
- End Sub
- Dim i As Integer
- Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 13 Then
- If i = 2 Then
- MsgBox "That's 3"
- Unload Me
- End If
-
- If TextBox1 = "1234" Then
- MsgBox "Correct password"
- Else
- i = i + 1
- End If
-
- End If
- End Sub
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
- If CloseMode = vbFormControlMenu Then
- MsgBox "Maaf , anda perlu tahu password untuk menutup form ini", vbCritical, "KURT"
- Cancel = True
- End If
- End Sub
Copy the Code
[ Last edited by 蝯z坞悬衻 on 28-7-2004 at 01:33 AM ] |
|
|
|
|
|
|
seek1u This user has been deleted
|
ok..back to the topic..maybe i have found something..plz dont ask anything..i
dunno anything aboiut access:lol
i found this via search from google try it..:
- ' Declare for call to mpr.dll.
- Declare Function WNetGetUser Lib "mpr.dll" _
- Alias "WNetGetUserA" (ByVal lpName As String, _
- ByVal lpUserName As String, lpnLength As Long) As Long
- Const NoError = 0 'The Function call was successful
- Public Function GetUserName()
- ' Buffer size for the return string.
- Const lpnLength As Integer = 255
- ' Get return buffer space.
- Dim status As Integer
- ' For getting user information.
- Dim lpName, lpUserName As String
- ' Assign the buffer size constant to lpUserName.
- lpUserName = Space$(lpnLength + 1)
- ' Get the log-on name of the person using product.
- status = WNetGetUser(lpName, lpUserName, lpnLength)
- ' See whether error occurred.
- If status = NoError Then
- ' This line removes the null character. Strings in C are null-
- ' terminated. Strings in Visual Basic are not null-terminated.
- ' The null character must be removed from the C strings to be used
- ' cleanly in Visual Basic.
- lpUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
- Else
- ' An error occurred.
- MsgBox "Unable to get the name."
- End
- End If
- ' Display the name of the person logged on to the machine.
- 'MsgBox "The person logged on this machine is: " & lpUserName
- GetUserName = lpUserName
- End Function
Copy the Code |
|
|
|
|
|
|
|
Originally posted by 蝯z坞悬衻 at 28-7-2004 01:24 AM:
yup agreed..
vba lah yg mengerakkan macro utuk semua ms office product termasuk access ,
excel , words dan power point..
vba mmg adik beradik ngan vb..tp tak sama..cth..cam ku ..leh buat ...
:setuju:..walaupun secara asasnya product Ms Office ni guna VB code tapi utk setiap application coding nyer berbeza. Kalu ms Access dah ade template dia maksudnya tak jauh sangat ngan vb tapi kalu excell ..pergh plain sheet utk coding.. kiter kene define sendirik....
kenkadaang mase keje tu terpikir aku, terrornya sapa yg buat ms Opis nye application ni kan...cam ner lah dorang bleh terpikir nak buat application cam ni.. Salute aku..:solute: |
|
|
|
|
|
|
|
penah buat projet pakai vb ngan access ni... buat database untOk library... dah berapa tahun dah... langsOng luper... ekekeke... :lol |
|
|
|
|
|
|
|
Ada lagi yang baca thread ni? Kalau ada saya kasi my 2 cents' worth...
1. Create table USER, masukkan 2 field (username dan password). Kalau nak buat primary key or add additional fields terpulang.
2. Create satu form, dalam form tu add 2 text box and 1 command button. Namakan text box pertama as: txtUsername, dan text box kedua as: txtPassword. Command button tu namakan dia sbg cmdLogin.
3. Pada butang cmdLogin tu, pada window Properties, kita set event On Click, dan select Code Builder (apabila butang tiga titik tersebut ditekan).
4. Kodkan seperti berikut:
dim rs as new adodb.recordset
rs.activeconnection = currentproject.connection
rs.open "select * from [user] where [username] = '" & me.txtUsername & "' and [password] = '" & me.txtPassword & "'"
if not rs.eof then
' --- rekod dijumpai ---
else
' --- rekod tak jumpa ---
msgbox "Maaf, kata laluan salah."
end if
Harap dpt membantu.
[ Last edited by shahnazz on 18-8-2004 at 05:58 PM ] |
|
|
|
|
|
|
seek1u This user has been deleted
|
tokey thread ni pun dah lama ilang |
|
|
|
|
|
|
eye2kay This user has been deleted
|
Originally posted by 蝯z坞悬衻 at 21-8-2004 00:15:
tokey thread ni pun dah lama ilang
DUDE.. ko kat sini rupanya... ko buat programming lak ke?? |
|
|
|
|
|
|
|
[quote]Originally posted by 蝯z坞悬 |
|
|
|
|
|
|
seek1u This user has been deleted
|
Originally posted by eye2kay at 9-9-2004 10:37 AM:
DUDE.. ko kat sini rupanya... ko buat programming lak ke??
kecil2 an je.hehe..:bgrin: |
|
|
|
|
|
|
| |
|