need help on simple database
Im creating a simple database that handle of pin and mobile number
Ex.
When i add a pin on my pin.mdb e.g 1234567890,8888899999,9876512345
Now i have this in my form:
Quote:
Text1.Text 'mobile number
Text2.Text 'messages
ok, when Text2.Text receive a message format:
Quote:
1234567890 09185695062
i want the find in my pin.mdb if this is exist mobile number 09185695062 will be registered in the system..
so later when Text1.Text receive mobile number from 09185695062 he will accept the messages else he will ignored it...
how to make this? also once this pin is being used 1234567890 give a reply sorry its been registered already..
Re: need help on simple database
What have you done so far? post it here.
Re: need help on simple database
@Simply Me
hi, i only done with adding pin numbers on pin.mdb thats only..
br
Re: need help on simple database
I'm not completely sure of what you are trying to do, but if you need to parse those strings and do something with each element, try this
VB Code:
Dim arrPin() As String
Dim strPin As String
strPin = "1234567890,8888899999,9876512345"
arrPin = Split(strPin,",")
'now
'arrPin(0) = 1234567890
'arrPin(1) = 8888899999
'arrPin(2) = 9876512345
Hope this helps.
Re: need help on simple database
@Hack
Thanks..
actually i have pin.mdb (all the pin are stored from this file)
Quote:
1234567890 'pin
09185695062 'mobile number
also Text1.text Receive this number 09185695062
what im trying to do is when the Text2.Text receive e.g
Quote:
1234567890 09185695062
i want this 1234567890 find in pin.mdb if this pin is exist store in another database together with mobile number.. so once its been registered make the pin is not usable if another mobile attempt to registered it..
and this is my problem now..
br
Re: need help on simple database
Ok, then the same basic logic applies. Using Split you can create an array out of 1234567890 09185695062 with 1234567890 being element 0 of the array. Once you have that, you can write an SQL SELECT statement WHERE fieldname = arrPin(0)
If you get a return, then you know that the pin is already there. If you get no returns, it is not.
Re: need help on simple database
do you have sample code of that sql statement?