If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DAO parameter length
When I run the code below an error is thrown at line 4 when the string
sc.notes is greater than 255 characters. Is there any way to allow parameters to contain more than 255 characters? 1 Public Function saveSCToDB(sc As Scorecard, query_Name As String) As Boolean 2 Dim qdf1 As DAO.QueryDef 3 Set qdf1 = EMAT_DB.QueryDefs(query_Name) 4 qdf1.Parameters("[@Notes]") = sc.Notes .... |
#2
|
|||
|
|||
DAO parameter length
Maybe. Try declaring the parameter "@Notes" as a memo type in your query.
Parameters [@Notes] Text; SELECT .... Otherwise try truncating your reference to sc.notes to 255 characters. I find it hard to imagine that you would get many extra records returned with 255 characters for a match. John Spencer Access MVP 2002-2005, 2007-2008 The Hilltop Institute University of Maryland Baltimore County Joseph Walkenhorst wrote: When I run the code below an error is thrown at line 4 when the string sc.notes is greater than 255 characters. Is there any way to allow parameters to contain more than 255 characters? 1 Public Function saveSCToDB(sc As Scorecard, query_Name As String) As Boolean 2 Dim qdf1 As DAO.QueryDef 3 Set qdf1 = EMAT_DB.QueryDefs(query_Name) 4 qdf1.Parameters("[@Notes]") = sc.Notes ... |
#3
|
|||
|
|||
DAO parameter length
Joseph Walkenhorst wrote:
When I run the code below an error is thrown at line 4 when the string sc.notes is greater than 255 characters. Is there any way to allow parameters to contain more than 255 characters? 1 Public Function saveSCToDB(sc As Scorecard, query_Name As String) As Boolean 2 Dim qdf1 As DAO.QueryDef 3 Set qdf1 = EMAT_DB.QueryDefs(query_Name) 4 qdf1.Parameters("[@Notes]") = sc.Notes ... Unfortunately, according to the Access specifications: Attribute Maximum Number of characters for a parameter in a 255 parameter query You either have to use dynamic sql or a recordset. I would suggest the latter. -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" |
Thread Tools | |
Display Modes | |
|
|