ms-access

Access 2007, VBA: Strange error when inserting BLOB into a linked table

心不动则不痛 提交于 2020-06-01 05:18:24
问题 I have a strange error when trying to insert binary into a varbinary column. Architecture is as follows: SQL Server 2008 database with this table object: CREATE TABLE [dbo].[BLOBs] ( [FileName] nvarchar(128) NOT NULL , [FileExt] AS CASE WHEN CHARINDEX(N'.', [FileName]) > 0 THEN REVERSE(SUBSTRING(REVERSE([FileName]), 1, CHARINDEX('.', REVERSE([FileName])) - 1)) ELSE NULL END PERSISTED , [FileBLOB] [varbinary](max) NOT NULL , CONSTRAINT [PK_BLOBs] PRIMARY KEY CLUSTERED ( [FileName] ASC ) ON

Access 2007, VBA: Strange error when inserting BLOB into a linked table

。_饼干妹妹 提交于 2020-06-01 05:16:05
问题 I have a strange error when trying to insert binary into a varbinary column. Architecture is as follows: SQL Server 2008 database with this table object: CREATE TABLE [dbo].[BLOBs] ( [FileName] nvarchar(128) NOT NULL , [FileExt] AS CASE WHEN CHARINDEX(N'.', [FileName]) > 0 THEN REVERSE(SUBSTRING(REVERSE([FileName]), 1, CHARINDEX('.', REVERSE([FileName])) - 1)) ELSE NULL END PERSISTED , [FileBLOB] [varbinary](max) NOT NULL , CONSTRAINT [PK_BLOBs] PRIMARY KEY CLUSTERED ( [FileName] ASC ) ON

Access Cumulative Total by Date

不打扰是莪最后的温柔 提交于 2020-05-30 06:18:38
问题 I need to show the cumulative power of all our energy projects by their online date. So, if a project came online in 2016, it was also online in 2017 and 2018 and should be counted in those totals. I basically need a table that answers the questions "What was our energy capacity as of 12/31/2016, 12/31/2017,etc" I can do it by running a simple query over and over with different dates, but ideally I would run just one query and get the table I need. I don't actually know how to code in SQL, so

Drag and Drop File into Microsoft Access

守給你的承諾、 提交于 2020-05-27 12:38:17
问题 I have a form in Microsoft Access which lets users upload attachments to each record. I'd like to make it a little user friendly by letting users drag and drop files into the attachment field. What is the best way of doing this/how do I do this? 回答1: Drag and drop might be a bit more sophisticated, how about VBA code to manipulate what you wish to achieve? This article has a great reference to what you wish to do. http://www.access-freak.com/tutorials.html#Tutorial07 回答2: Here is a way to

Drag and Drop File into Microsoft Access

纵饮孤独 提交于 2020-05-27 12:37:04
问题 I have a form in Microsoft Access which lets users upload attachments to each record. I'd like to make it a little user friendly by letting users drag and drop files into the attachment field. What is the best way of doing this/how do I do this? 回答1: Drag and drop might be a bit more sophisticated, how about VBA code to manipulate what you wish to achieve? This article has a great reference to what you wish to do. http://www.access-freak.com/tutorials.html#Tutorial07 回答2: Here is a way to

How to count number of fields in a table?

余生颓废 提交于 2020-05-26 05:07:08
问题 I am trying to count number of fields in a table in Access 2010. Do I need a vb script? 回答1: You can retrieve the number of fields in a table from the .Count property of the TableDef Fields collection. Here is an Immediate window example ( Ctrl + g will take you there) ... ? CurrentDb.TableDefs("tblFoo").Fields.Count 13 If you actually meant the number of rows instead of fields, you can use the TableDef RecordCount property or DCount . ? CurrentDb.TableDefs("tblFoo").RecordCount 11 ? DCount("

Access2010 error when running: alter table S alter column AGE SMALLINT;

一世执手 提交于 2020-05-24 05:33:05
问题 I only use 'Create' to create a table named 'S'.And 'AGE' is one of its columns.The data type of 'AGE' is INT. create table S(SNO char(12),SNAME varchar(10),AGE int,SEX char(1),SDEPT varchar(255),primary key(SNO)); When running the following code, appearing messagebox:'Object is invalid or no longer set'. I am new to Access.Please tell me how to fix it.Thanks! alter table S alter column AGE SMALLINT; 来源: https://stackoverflow.com/questions/61204560/access2010-error-when-running-alter-table-s

Access2010 error when running: alter table S alter column AGE SMALLINT;

纵饮孤独 提交于 2020-05-24 05:33:00
问题 I only use 'Create' to create a table named 'S'.And 'AGE' is one of its columns.The data type of 'AGE' is INT. create table S(SNO char(12),SNAME varchar(10),AGE int,SEX char(1),SDEPT varchar(255),primary key(SNO)); When running the following code, appearing messagebox:'Object is invalid or no longer set'. I am new to Access.Please tell me how to fix it.Thanks! alter table S alter column AGE SMALLINT; 来源: https://stackoverflow.com/questions/61204560/access2010-error-when-running-alter-table-s

Sending Emails with Attachments VBA

醉酒当歌 提交于 2020-05-23 13:58:47
问题 I am trying to add an attachment functionality to my emails. My email code is working however the attachments are being sent as ATT00001.bin files. The variable Forms![frmMain]!TabCtl54.Pages("page56").Controls("subtblcontent").Form![attachmentlnk] is a textbox on a form which is where I would put my file name. attachmentlnkvar = "file:///C:/Users/desktopname/Desktop/" & Forms![frmMain]!TabCtl54.Pages("page56").Controls("subtblcontent").Form![attachmentlnk] & ".pdf" With cdomsg .To = emailstr

How to change the caption of multiple button instances in excel vba

纵然是瞬间 提交于 2020-05-17 08:49:24
问题 With this code, I have created multiple instances of button using copy and paste but when I change the caption of second button, it is changing the caption of first button Sub CopyActiveX(address) Application.ScreenUpdating = False Dim X As OLEObject, Y As OLEObject Dim newButtonName As String Dim count As Integer count = 0 For Each X In ActiveSheet.OLEObjects count = count + 1 Debug.Print X.Name If X.Name = "btnFindSeries" Then newButtonName = X.Name + "" + CStr(count) End If Next X Set X =