Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


problem unclosed quotation mark before character string '''



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Visual Basic Forum
View previous topic :: View next topic  
Author Message
waiwaisan



Joined: 04 Jan 2007
Posts: 2

PostPosted: Thu Jan 04, 2007 4:23 am    Post subject: problem unclosed quotation mark before character string ''' Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
waiwaisan



Joined: 04 Jan 2007
Posts: 2

PostPosted: Thu Jan 04, 2007 10:36 am    Post subject: Re: problem unclosed quotation mark before character string ''' Reply with quote

no people know solve this problem?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Visual Basic Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
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:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap