Rabu, 23 Januari 2019

[MS_AccessPros] Top right comma won't be inserted .

 

Dear All,
I've been using SQL Insert method for quite a while, and always get the best result I wanted, except for this one,the text with top right comma " ' " , it will stop the SQL insert. Can this be solved?

Here is the code:
Dim strSQL As String
strSQL = "INSERT INTO tblSubRoomingList (SeqNo, CityBookingID, SRLGroupID, ChineseName, EnglishName, GuestGender, PassportNumber, " & _
"DateOfBirth, Birthplace, PlaceOfIssue, IssuingDate, ExpiryDate, GuestType, RoomType, Remark) " & _
"SELECT tblRoomingList.SeqNo, " & Nz(Me.CityBookingID, 0) & ", " & Me.CBGroupID & ", tblRoomingList.ChineseName, " & _
"tblRoomingList.EnglishName, tblRoomingList.GuestGender, tblRoomingList.PassportNumber, tblRoomingList.DateOfBirth, " & _
"tblRoomingList.Birthplace, tblRoomingList.PlaceOfIssue, tblRoomingList.IssuingDate, tblRoomingList.ExpiryDate, " & _
"tblRoomingList.GuestType, tblRoomingList.RoomType, tblRoomingList.Remark " & _
"FROM tblRoomingList " & _
"WHERE tblRoomingList.GroupID = " & Me.CBGroupID

CurrentDb.Execute strSQL, dbFailOnError
Me.Requery

If the "EnglishName" contains " ' ",It won't start the process. Please help! Thanks.

Best Regards,
Kevin

__._,_.___

Posted by: Qingqing <qingqinga@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar