Can someone please tell me what's wrong with this code. Been working on it for hours.
The error seems to be at the line ".open" where it tells me that it cannot find the record source (something like as I get the error message in Arabic).VB Code:
Dim sConnString As String Dim rsTempRecordSet As New ADODB.Recordset Dim cnTeamCMI As New ADODB.Connection Dim sSQl As String strConnString = "Driver= {MicrosoftAccessDriver(*.mdb)};DBQ=C:\Documents and Settings\ÅÓáÇã\ÓØÍ ÇáãßÊÈ\ÈÑäÇãÌ ÇáÍÖæÑ æ ÇáÇäÕÑÇÝ\database.mdb;Uid=Your_Username;Pwd=Your_Password;" With cnTeamCMI .ConnectionString = sConnString .ConnectionTimeout = 0 .CursorLocation = adUseClient .Open End With sSQl = "SELECT [ÑÕíÏ ÇáÅÌÇÒÇÊ] FROM [ÇáÅÏÇÑí] WHERE [ÇÓã ÇáÚÇãá] = '" & lstMngment.List(lstMngment.ListIndex) & "', ADOCn" rsTempRecordSet.Open sSQl, cnTeamCMI, adOpenStatic, adLockReadOnly With rsTempRecordSet If .Fields("ÑÕíÏ ÇáÅÌÇÒÇÊ") = "9" Then cmdMGTHoliday.Enabled = False Else cmdMGTHoliday.Enabled = True End If End With rsTempRecordSet.Close Set rsTempRecordSet = Nothing Set cnTeamCMI = Nothing
Any suggestions would be greatly appreciated. Thanx in advance![]()




Reply With Quote