|
It is currently Thu Jan 08, 2009 8:47 pm
|
View unanswered posts | View active topics
|
Page 1 of 1
|
[ 2 posts ] |
|
| Author |
Message |
|
waiwaisan
|
Post subject: problem unclosed quotation mark before character string ''' Posted: Thu Jan 04, 2007 4:23 am |
|
Joined: Thu Jan 04, 2007 3:57 am Posts: 2
|
|
Hihi
Anyone cam help me? I am facing this problem when I key in the ' (apostrophe) then it occur runtime error.
This is the code
'Method name: query
'Method Description: to run select-statement and return the results
'Parameters pass in: s (SQL select-statement)
' : cursorType (cursorType for connection)
' : lockType (connection lock type)
'Parameters return: query (recordset that stores the results)
Public Function query(ByVal sql As String, _
Optional ByVal cursorType As CursorTypeEnum = adOpenForwardOnly, _
Optional ByVal lockType As LockTypeEnum = adLockReadOnly) As ADODB.Recordset
On Error GoTo errHdl
Set query = New ADODB.Recordset
With query
.CursorLocation = adUseClient
.Open sql, con, cursorType, lockType
Debug.Print Time & " sql queried" & vbNewLine & _
vbTab & sql & vbNewLine & _
vbTab & "with " & query.RecordCount & " row(s) returned"
.ActiveConnection = Nothing
End With
Exit Function
errHdl:
Debug.Print Time & " error query sql" & vbNewLine & _
vbTab & sql & vbNewLine & _
vbTab & Err.description
Err.Raise Err.Number, "DB.query", Err.description <------- error
End Function
Hope anyone can help me. Thanks
|
|
| Top |
|
 |
|
waiwaisan
|
Post subject: Posted: Thu Jan 04, 2007 10:36 am |
|
Joined: Thu Jan 04, 2007 3:57 am Posts: 2
|
|
no people know solve this problem?
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums. Click here to Register
If you are a current member here on DEVPPL, please login below:
|
|
|