Click here to Skip to main content
15,893,923 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
When I go to fill the dataset I get the following error. No value given for one or more required parameters. I have looked the error up and my code seems fine. I cannot figure out the problem. The code is as follows.
Try
     
 Dim OleDBConn1 As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(CONN_STRING)

Dim DataSet1 As New DataSet()

Dim OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(strSQL, OleDBConn1)

 OleDBConn1.Open()

 OleDbDataAdapter1.Fill(DataSet1, CURRENT_TABLE.Name) <=this line gives me the error

oleDBConn1.close
Posted
Updated 16-Apr-14 5:27am
v2
Comments
Abinash_Sahoo 16-Apr-14 11:52am    
please include the value of strSQL as well. some problem must be there.
Member 10753956 16-Apr-14 12:19pm    
strsql="SELECT ACTIVITY_734_0414_2.[ID], ACTIVITY_734_0414_2.[RECORD_TYPE], ACTIVITY_734_0414_2.[SEQUENCE_NUMBER_SPOTCHECK], ACTIVITY_734_0414_2.[EXTRACT_DATE], ACTIVITY_734_0414_2.[EXTRACT_TIME], ACTIVITY_734_0414_2.[ACTIVITY], ACTIVITY_734_0414_2.[IDENT_INST], ACTIVITY_734_0414_2.[IDENT_INST_NEW], ACTIVITY_734_0414_2.[BARCODE], ACTIVITY_734_0414_2.[BARCODE_NEW], ACTIVITY_734_0414_2.[CAGE], ACTIVITY_734_0414_2.[CALINT], ACTIVITY_734_0414_2.[DATEDUE], ACTIVITY_734_0414_2.[DATELBL], ACTIVITY_734_0414_2.[DISCREPANCIES], ACTIVITY_734_0414_2.[FRAME], ACTIVITY_734_0414_2.[FUNCTL_DESC], ACTIVITY_734_0414_2.[IDENT_MAIN_ITEM], ACTIVITY_734_0414_2.[INVENT_STATUS_CD], ACTIVITY_734_0414_2.[IP_FLAG], ACTIVITY_734_0414_2.[LABCODE], ACTIVITY_734_0414_2.[LATLOC], ACTIVITY_734_0414_2.[LEVEL], ACTIVITY_734_0414_2.[LOCATION], ACTIVITY_734_0414_2.[MODEL], ACTIVITY_734_0414_2.[NARRATIVE_EQUIP], ACTIVITY_734_0414_2.[NARRATIVE_INSTLCONFIG], ACTIVITY_734_0414_2.[NOMEN], ACTIVITY_734_0414_2.[OPTIONS], ACTIVITY_734_0414_2.[RANGE], ACTIVITY_734_0414_2.[REMARKS_EQUIP], ACTIVITY_734_0414_2.[REMARKS_INSTLCONFIG], ACTIVITY_734_0414_2.[REMARKS_SPOTCHECK], ACTIVITY_734_0414_2.[SERIAL], ACTIVITY_734_0414_2.[SPOTCHECK_CODE], ACTIVITY_734_0414_2.[SPOTCHECK_DATE], ACTIVITY_734_0414_2.[STANDARD_FLAG], ACTIVITY_734_0414_2.[SUPPORT_CODE], ACTIVITY_734_0414_2.[SYSTEM_STATUS_CODE], ACTIVITY_734_0414_2.[SVCRMKS], ACTIVITY_734_0414_2.[VERIFY_ACTION_TAKEN], ACTIVITY_734_0414_2.[VERIFY_BHLOC], ACTIVITY_734_0414_2.[VERIFY_CAGE], ACTIVITY_734_0414_2.[VERIFY_CALINT], ACTIVITY_734_0414_2.[VERIFY_CODE], ACTIVITY_734_0414_2.[VERIFY_DATE], ACTIVITY_734_0414_2.[VERIFY_DATEDUE], ACTIVITY_734_0414_2.[VERIFY_DATELBL], ACTIVITY_734_0414_2.[VERIFY_DISCREPANCIES], ACTIVITY_734_0414_2.[VERIFY_FRAME], ACTIVITY_734_0414_2.[VERIFY_FUNCTL_DESC], ACTIVITY_734_0414_2.[VERIFY_IDENT_INST], ACTIVITY_734_0414_2.[VERIFY_LABCODE], ACTIVITY_734_0414_2.[VERIFY_LATLOC], ACTIVITY_734_0414_2.[VERIFY_LEVEL], ACTIVITY_734_0414_2.[VERIFY_LOCATION], ACTIVITY_734_0414_2.[VERIFY_MODEL], ACTIVITY_734_0414_2.[VERIFY_OPTIONS], ACTIVITY_734_0414_2.[VERIFY_RECOMMENDED_ACTION], ACTIVITY_734_0414_2.[VERIFY_REMARKS], ACTIVITY_734_0414_2.[VERIFY_SERIAL], ACTIVITY_734_0414_2.[VERIFY_SUPPORT_CODE], ACTIVITY_734_0414_2.[VERIFY_WCWA], ACTIVITY_734_0414_2.[WC_WA] FROM ACTIVITY_734_0414_2"
Richard MacCutchan 16-Apr-14 12:21pm    
Please do not just dump unformatted text like this. Edit your question and format it properly so people can read it.
Richard MacCutchan 16-Apr-14 12:20pm    
What is the value of CURRENT_TABLE.Name?
Member 10753956 16-Apr-14 12:23pm    
it is the table ACTIVITY_734_0414_2

1 solution

There is a field called spotcheck_record_type that is being pulled from code but is not in access therefore access is looking at this sql field as an expression. I commented the column out and the sql runs correctly through .net into access and pulls the correct records. The only problem now is finding out where in this code it is pulling the spotcheck_record_type field from.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900