ms-access

Recommended way to read and write .ini files in VBA

孤者浪人 提交于 2020-03-17 07:14:09
问题 Are any methods available in VBA to read and write INI files? I know I could use; Open "C:\test.ini" For Input As #1 ...and parse the data. Instead I am trying to see what tools are already available. I know in C# you can do... using INI; INIFile ini = new INIFile("C:\test.ini"); Is there an equivalent for VBA? I am attempting this in MS Access 2003 VBA. 回答1: Here are some code snippets that we use, it should help you to get the idea. These routines use the API calls. Two functions are

Connecting Excel to Access

巧了我就是萌 提交于 2020-03-12 05:32:20
问题 I'm trying to connect excel on a database which has the following query. SELECT * FROM Products WHERE Order = [Enter Order] but excel can't seem to find this query. It only shows the actual table and other queries which does not use parameters. Is there a way to connect excel on a query which uses parameters? I'm using MS-Excel 2007. 回答1: Some notes. "Parameter queries must be created in Microsoft Query." Customize a parameter query Use Microsoft Query to retrieve external data ADODB & VBA '

Connecting Excel to Access

随声附和 提交于 2020-03-12 05:30:46
问题 I'm trying to connect excel on a database which has the following query. SELECT * FROM Products WHERE Order = [Enter Order] but excel can't seem to find this query. It only shows the actual table and other queries which does not use parameters. Is there a way to connect excel on a query which uses parameters? I'm using MS-Excel 2007. 回答1: Some notes. "Parameter queries must be created in Microsoft Query." Customize a parameter query Use Microsoft Query to retrieve external data ADODB & VBA '

Connecting Excel to Access

你离开我真会死。 提交于 2020-03-12 05:28:59
问题 I'm trying to connect excel on a database which has the following query. SELECT * FROM Products WHERE Order = [Enter Order] but excel can't seem to find this query. It only shows the actual table and other queries which does not use parameters. Is there a way to connect excel on a query which uses parameters? I'm using MS-Excel 2007. 回答1: Some notes. "Parameter queries must be created in Microsoft Query." Customize a parameter query Use Microsoft Query to retrieve external data ADODB & VBA '

How do I display a memo field to a Form in Access

左心房为你撑大大i 提交于 2020-03-06 08:09:32
问题 I have looked at the previous questions asked relating to this but haven't been able to find a solution. I have a table with a memo field called "Comments", and I am trying to display all the history of the field in the form. In the text box properties in the control source I have this: ColumnHistory([Positions], [Comments], [JobID=]&[JobID]) (Positions is the table name, Comments is the memo field, and JobID is the primary key indentifier). I get a #Name error in the field and I dont

Access VBA: Shell command broken in one particular database

半腔热情 提交于 2020-03-05 05:19:24
问题 I have two Access databases that I'm opening on the same computer. In one, running this in the immediate window works as expected (opens Notepad): Shell "notepad.exe" In the other, I get this error instead: Run-time error '5': Invalid procedure call or argument I have not been able to come up with any shell command that will run successfully in that second database. No matter what, I get that error. What is going on here? Could there be a security setting coming into play? Or perhaps one is

VBA String Variable Contains Other Variable

你。 提交于 2020-03-05 00:33:20
问题 I have a string that I am trying to build with text and other variables. Is there a way to build the string so that I can use other variables ? I have a text file that my vba is reading to compose the body of an email. The text file has this line: email_body|"Final Reports will be distributed on or after \" & Me.cbo_Month.Column(0) & \" 10th. I am calling the function MessageBody = getAdmSetting("email_body") which returns the string exactly: Final Reports will be distributed on or after \" &

VBA String Variable Contains Other Variable

[亡魂溺海] 提交于 2020-03-05 00:30:12
问题 I have a string that I am trying to build with text and other variables. Is there a way to build the string so that I can use other variables ? I have a text file that my vba is reading to compose the body of an email. The text file has this line: email_body|"Final Reports will be distributed on or after \" & Me.cbo_Month.Column(0) & \" 10th. I am calling the function MessageBody = getAdmSetting("email_body") which returns the string exactly: Final Reports will be distributed on or after \" &

MS Access Query for time In/Out attendance

为君一笑 提交于 2020-03-05 00:24:33
问题 I'm doing a project which involves time and attendance management. When I download data from the biometric reader, I got the records in the following format, USERID CHECKTIME 5001 12/09/2011 09:05:34 5002 12/09/2011 09:33:13 5001 12/09/2011 13:05:53 5002 12/09/2011 13:22:24 5001 12/09/2011 14:05:22 5002 12/09/2011 14:33:53 5001 12/09/2011 18:05:09 5002 12/09/2011 17:44:34 This is the image I want to show the above records as follows, (the Log_In, LB_Out, LB_In, Log_Out, WorkTime and

The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine even if it actually IS installed

限于喜欢 提交于 2020-03-03 05:05:09
问题 I try to connect .accdb file as a data source to my Windows Form application in Visual Studio. It keep saying the Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine. Error screenshot plus listed OleDb enumeratos I have installed all the recommended runtimes on related Answers marked as Accepted/working: Microsoft Access database engine 2010 (x64) Microsoft Access database engine 2016 (x64) Microsoft Access Runtime 2010 (x64) Microsoft Access Runtime 2013 (x64) but still