I really have no idea what my problem is or where (the database or Visual Basic) the problem actually is.
Symptoms
I have a function that queries a table and obtains the value from a single defined field then assigns the value to a variable, and finally returns the variable. What occurs is that the query yields the value from a different column than the one requested in the query.
The database is ACCESS and the table consists of 15 text fields. Structurally, the table looks like below. When the query is executed, instead of picking up value from the field colFilePath, I am getting the value from colSet1.Code:Private Function GetFilePath(FileCabinet As String, MyUser As String) As Object 'Creates FilePath directory for non revision controlled articles. MyError = "Failed to create the file path." MasterBase.MasterBaseQuery("SELECT colFilePath FROM defMasterBase WHERE colName = '" & MyApp & "'") If ErrorReport.NoErrors(True) = False OrElse RecordCount < 1 Then MyDirectory = "" FileCabinet = MasterBase.ListTable.Rows(0).Item(0).ToString + MyUser + "\" + StaffID + "\" Directory.CreateDirectory(FileCabinet) Return FileCabinet End Function
As far as I can tell, the query is correct and I know of nothing that is wrong with the table. I will be happy to provide any additional information that would be helpful.




Reply With Quote
