ms-access

Syntax (Missing operator) error saving string contents to variable with RunSQL in VBA

六眼飞鱼酱① 提交于 2020-07-10 03:17:12
问题 I'm trying to take selected text from a text box and save the string to a table. There's only one row to the table, and the other variables ( SelectionStart , SelectionLength ) are able to save to the table without issue. When it gets to the third RunSQL command, I get the error: Run-Time error '3075': Syntax error (missing operator) in query expression and ends with the selected text. Sub ArticleTextContentBox_Click() Dim SelectionStart As String Dim SelectionLength As String Dim

Syntax (Missing operator) error saving string contents to variable with RunSQL in VBA

纵饮孤独 提交于 2020-07-10 03:12:17
问题 I'm trying to take selected text from a text box and save the string to a table. There's only one row to the table, and the other variables ( SelectionStart , SelectionLength ) are able to save to the table without issue. When it gets to the third RunSQL command, I get the error: Run-Time error '3075': Syntax error (missing operator) in query expression and ends with the selected text. Sub ArticleTextContentBox_Click() Dim SelectionStart As String Dim SelectionLength As String Dim

Should I use pyodbc or win32com to fill out pre-existing forms in a Microsoft Access Database (.accdb) using python?

匆匆过客 提交于 2020-07-09 12:48:50
问题 I wrote a python script that extracts strings from word documents. The goal is to then insert these strings into a pre-existing form in an Access database, save it, create a duplicate of the form, insert different strings from the next word document, save, repeat. The form already has all the fields I need, and it has buttons for 'save' and 'create duplicate.' I'm having trouble figuring out how to insert strings into the Access form. So far I've learned that there are at least two ways of

Open Excel 2010 file from Access 2010 VBA

a 夏天 提交于 2020-07-08 10:41:08
问题 I have both Excel 2003 and Excel 2010 on my machine. I'm using VBA in Access 2010 to open 2010 .xlsx files in Excel, but I notice they seem to be "opening" in Excell 2003 because that little "Converting data" dialog box pops up for a moment. Is there an easy way to be sure that Excel 2010 "opens" before the files open? Thanks, Ed 回答1: I don't have two versions of Excel on my computer so cannot test but I would think that the following would open the default Excel version, which I assume you

How can I use Ms Access Date/Time Extended data type

谁说胖子不能爱 提交于 2020-07-06 19:57:10
问题 Ms Access documentation suggests there is a data type called "Date/Time Extended" which: The Date/Time Extended data type stores date and time information and is similar to the Date/Time data type, but it provides a larger date range, a higher fractional precision, and compatibility with the SQL Server datetime2 date type. However I cannot select this as the option is not in the table design Data Type drop/down list. My version is Microsoft Access for Microsoft 365 (16.0.12827.20328) 64-Bit.

How can I use Ms Access Date/Time Extended data type

痞子三分冷 提交于 2020-07-06 19:56:29
问题 Ms Access documentation suggests there is a data type called "Date/Time Extended" which: The Date/Time Extended data type stores date and time information and is similar to the Date/Time data type, but it provides a larger date range, a higher fractional precision, and compatibility with the SQL Server datetime2 date type. However I cannot select this as the option is not in the table design Data Type drop/down list. My version is Microsoft Access for Microsoft 365 (16.0.12827.20328) 64-Bit.

Parse JSON with VBA (Access 2010)

余生长醉 提交于 2020-07-06 14:00:14
问题 I need to update a currency table in MS-Access with a JSON file below: { "timestamp": 1465843806, "base": "CAD", "rates": { "AED": 2.87198141, "AFN": 54.21812828, "ALL": 95.86530071, "AMD": 374.48549935, "ANG": 1.39861507 } } The VBA code is as follows: Private Sub cmdJsonTest_Click() Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1") MyRequest.Open "GET", "https://website.org/api/latest.json?base=CAD" MyRequest.send ' MsgBox MyRequest.ResponseText Dim Json As Object Set Json =

Trying to connect to access database with PDO

会有一股神秘感。 提交于 2020-07-03 08:00:31
问题 I am trying to connect to access database that I have on the c drive. I uncommented access extension pdo in INI file. I ran the driver test and it shows odbc driver is installed. I am using wamp with apache server but I keep getting this error SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <?php try { $conn = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\staffing.mdb;Uid=Admin"); } catch

Data type Number-Decimal

本小妞迷上赌 提交于 2020-07-03 07:23:41
问题 until few days ago everything was working fine and then I run into this problem. I wrote some code for Access vba in Microsoft 365 that run SQL query on some local and connected tables. One of this connected table has a field set as data type Number - Decimal. As I mention, few days ago this field start to return empty string. This are few steps I try to investigate the problem. I made a local copy of the connected table to make sure the problem was not coming from outside. No difference I

Change column data type and format

只谈情不闲聊 提交于 2020-06-28 10:06:22
问题 When importing the excel to access 2007, some date field had become text field. so i want to run query in access to change those columns data type to datetime. How can i pass the date format ("dd-mmm-yyyy") in sql ? ALTER TABLE Tbl1 ALTER COLUMN [ABC] datetime Thanks Joe 回答1: If you have imported a column (field) from Excel and it has ended up in text format, you should be very wary of simply switching to a date time format. Access should already have interpreted the field as DateTime if it