29. maj 2003 - 11:04Der er
12 kommentarer og 1 løsning
Function virker ikke mere
Function GetMachineName() As String 'Returns the computername Dim lngLen As Long, lngX As Long Dim strCompName As String lngLen = 16 strCompName = String$(lngLen, 0) lngX = apiGetComputerName(strCompName, lngLen) If lngX <> 0 Then GetMachineName = left$(strCompName, lngLen) Else GetMachineName = "" End If End Function
HVorfor får jeg pludselig fejl på 'left$', jeg har en anden database hvor denne funktion virker fint, jeg har tjekket referencerne. fejlen: "Compile error: Type-declaration character does not match declared data type"
Efter ti år i London, Madrid, Paris og Utrecht kommer Sabios AI-fokuserede program af arrangementer om kundeoplevelser, ‘Disrupt’, for første gang til Danmark.
OK, had another look and teh code seems OK, but I think you can remove $ from left still.
Try compiling the program. Quit eoften IF you have a MISSING reference then it will give strange side effects such as this. IF you get an error when compiling then this should give an indication to the problem.
i have narrowed it down a bit, it isn't the code displayed here that is triggin the error, it seems to my error handling: NOT working: Function report_error(mask, LOgin, Form, Err, felt) Dim CONN As ADODB.Connection Set CONN = CurrentProject.Connection CONN.Execute "exec sp_Error " & "'" & Form & "'," & "'" & Err & "'," & "'" & mask & "'," & "'" & LOgin & "'," & "'" & felt & "'" Set CONN = Nothing End Function
Working: Function report_error(mask, LOgin, Form, Err) Dim CONN As ADODB.Connection Set CONN = CurrentProject.Connection CONN.Execute "exec sp_Error " & "'" & mask & "'," & "'" & LOgin & "'," & "'" & Form & "'," & "'" & Err & "'" Set CONN = Nothing End Function
I'm glad I don't have a loaded gun in the house, Chances are that I would have issued a death penalty on myself. *lol*
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.