establish connection to a thumbprint reader using vb6

i don't know how to create the connection to the reader, error 424

Page 1 of 1

1 Replies - 2871 Views - Last Post: 16 July 2009 - 08:26 PM Rate Topic: -----

#1 popeto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-July 09

establish connection to a thumbprint reader using vb6

Post icon  Posted 16 July 2009 - 07:37 PM

I'm trying to establish the connection to the thumbprint reader, i have the device manual attached here;

here's the code problem with the code;

Private Sub Command1_Click()


Dim ipAdd As String
Dim portNo As Long
Dim bconn As Boolean


ipAdd = "192.168.1.201"
portNo = "4370"
bconn = CZKEM1.Connect_Net(CStr(ipAdd), CLng(portNo))   //ERROR OCCURED HERE-->>RUNTIME ERROR 424,OBJECT REQUIRED

If bconn = True Then
	CZKEM1.EnableDevice MACHINENUMBER, False
End If





Here's the device manualAttached File  zkemsdk_manual.pdf (381.28K)
Number of downloads: 1435

Please help me, i'm stuck with this code like forever.

However i will give you my guidelines that i used to make the code


Public Sub tmrTimer_Timer()

Dim devModel As String
Dim reader As Integer
Dim devNo As Integer
Dim ipAdd As String
Dim porNo As Long
Dim comm As Long
Dim commPort As Long
Dim baudRate As Long
Dim EnrollNumber As String
Dim log As Long
Dim IsInValid As Long
Dim Year As Long
Dim Month As Long
Dim Day As Long
Dim Hour As Long
Dim Minute As Long
Dim Second As Long
Dim WorkCode As Long
Dim dwMachineNumber As Long
Dim dwEnrollNumber As Long
Dim dwVerifyMode As Long
Dim dwInOutMode As Long
Dim dwYear As Long
Dim dwMonth As Long
Dim dwDay As Long
Dim dwHour As Long
Dim dwMinute As Long
Dim dwSecond As Long
Dim dwWorkCode As Long
Dim dwReserved As Long

'MYSQL CONNECTOR VARIABLE
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
Dim rs As New ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim oCmd As ADODB.Command
 
'ADITIONAL VARIABLE
Dim date_current As String
Dim time_current As String
Dim yr_tmp As String
Dim mth_tmp As String
Dim day_tmp As String
Dim hr_tmp As String
Dim min_tmp As String
Dim sec_tmp As String
Dim id As String
Dim code As String
Dim verify As String
Dim verify_tmp As String
Dim id_tmp As String


	Dim bconn As Boolean
	Dim mint As Integer
	
	
'Open log file
fn = FreeFile
Open "e:\log\log.txt" For Append As #fn
	
'==============================================================================================================================================================================================================================================
'MYSQL DATABASE

oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
	"Server=localhost;" & _
	"Port=3306;" & _
	"Option=16384;" & _
	"Stmt=;" & _
	"Database=ehadirv2jkr;" & _
	"Uid=root;" & _
	"Pwd=;"
	
	'Date
   date_current = Format(Now, "yyyymmdd")
   time_current = Format(Now, "hhmmss")
 
'===========================================================================================================================================================================================================================================
'READER KORAYA
devModel = "AC800+"
devNo = "1"
ipAdd = "192.168.1.201"
portNo = "4370"
comm = "0"
commPort = "0"
baudRate = "115200"
reader = "1"
		
	
	
	If portNo = "" Then Exit Sub
		bconn = CZKEM1.Connect_Net(CStr(ipAdd), CLng(portNo))
		If CZKEM1.ReadGeneralLogData(CInt(devNo)) And time_current > 60500 And time_current < 200000 Then
			Write #fn, "============================================================================ "
			Write #fn, "Date : " + date_current + "	 Time : " + time_current
			Write #fn, "Id		 Date		 Time		 WorkCode	Reader	  IpAdress	  Verify"
			Do While CZKEM1.GetGeneralExtLogData(CInt(devNo), dwEnrollNumber, dwVerifyMode, dwInOutMode, dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond, dwWorkCode, dwReserved)

 'log date
				yr_tmp = (dwYear)
				mth_tmp = (dwMonth)
				day_tmp = (dwDay)
				
				If mth_tmp < 10 Then
					mth_tmp = "0" & mth_tmp
				Else
				End If
				
				If day_tmp < 10 Then
					day_tmp = "0" & day_tmp
				Else
				End If
				
				date_tmp = yr_tmp & mth_tmp & day_tmp
				
'log time
				hr_tmp = (dwHour)
				min_tmp = (dwMinute)
				sec_tmp = (dwSecond)
					
				If hr_tmp < 10 Then
					hr_tmp = "0" & hr_tmp
				Else
				End If
				
				If min_tmp < 10 Then
					min_tmp = "0" & min_tmp
				Else
				End If
				
				If sec_tmp < 10 Then
					sec_tmp = "0" & sec_tmp
				Else
				End If
				
				time_tmp = hr_tmp & min_tmp & sec_tmp
				
				date_time = date_tmp & time_tmp
'id convert
	
				id = (dwEnrollNumber)
				
											   
				code = (dwWorkCode)
				
'verify type
				verify = (dwVerifyMode)
				
				If verify = 0 Then
				   verify_tmp = "password"
				Else
				End If
				
				If verify = 1 Then
				   verify_tmp = "fprint"
				Else
				End If
				
				If verify = 2 Then
				   verify_tmp = "card"
				Else
				End If
				   
				
			
				
	 'insert log to mysql
				
				If ((code = 0) And (time_tmp > 53000 And time_tmp < 100000)) Then
				   code = 1
				Else
				End If
		  
				Write #fn, (id) + "	" & (date_tmp) + "	" & (time_tmp) + "			 " & (code) & "		 " & (reader) & "	   " & (ipAdd) & "   " & (verify_tmp)
				oConn.Execute "insert ignore into ea_attendancetxn (eaax_locid,eaax_termid,eaax_txndatetime,eaax_txnflag,eaax_staffid,eaax_mfgno,eaax_mykadflag) values ('" & reader & "',1,'" & date_time & "','" & code & "'," + "lpad('" + id + "', 5, '0') ,'" & verify & "',Null);"
		Loop
	

	
	 'erase reader log
		
		If (time_current > 81500 And time_current < 81800) Or (time_current > 130500 And time_current < 130800) Or (time_current > 144500 And time_current < 144800) Or (time_current > 180000 And time_current < 180300) Or (time_current > 164500 And time_current < 164800) Or (time_current > 235000 And time_current < 235300) Then
		   If CZKEM1.ClearGLog(CInt(devNo)) Then
			  Write #fn, "Erasing Reader 1 log"
			Else
			End If
		Else
		End If
		Else
		End If
		
	 
'=============================================================================================================================================================================================================================================
	 
 'CLOSING MYSQL & LOG FILE

Close #fn
oConn.Close


'==============================================================================================================================================================================================================================================
'RENAMING LOG FILE
	If (time_current > 180000 And time_current < 180200) Then
		Name "e:\log\log.txt" As "e:\log\" & (date_current) & "-" & (time_current) & "-log.txt"
	Else
	End If
	

End Sub




however, i only just want to start to make connection but failed....

This post has been edited by popeto: 16 July 2009 - 08:44 PM


Is This A Good Question/Topic? 0
  • +

Replies To: establish connection to a thumbprint reader using vb6

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: establish connection to a thumbprint reader using vb6

Posted 16 July 2009 - 08:26 PM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1