火鸟异常:表未知[重复](Firebird exception: Table unknown [duplicate])
这个问题在这里已有答案:
我可以使用以下连接字符串建立与Firebird数据库的连接:
ConnectionString = "User ID=SYSDBA;Password=masterkey;Database=localhost:C:\\MyDb\\mydb.FDB;DataSource=localhost;Charset=NONE;";
但是当C#代码尝试执行查询时,会出现以下错误:
动态SQL错误SQL错误代码= -204 表未知
我试过的代码:
using FirebirdSql.Data.FirebirdClient; ... FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbCommand readCommand = new FbCommand("Select Name From Customer;", connection); FbDataReader myreader = readCommand.ExecuteReader();
肯定存在Customer表(我已经用IBExpert检查过 - 我可以读取数据)。 我在Google上几乎找不到任何东西。
Firebird 2.5服务器正在我的计算机上运行。 可能是什么问题呢?
This question already has an answer here:
I could establish the connection to a Firebird database with the following connection string:
ConnectionString = "User ID=SYSDBA;Password=masterkey;Database=localhost:C:\\MyDb\\mydb.FDB;DataSource=localhost;Charset=NONE;";
But when the C# code tries to execute the query the following error comes:
Dynamic SQL Error SQL Error Code = -204 Table unknown
The code that I've tried:
using FirebirdSql.Data.FirebirdClient; ... FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbCommand readCommand = new FbCommand("Select Name From Customer;", connection); FbDataReader myreader = readCommand.ExecuteReader();
There definitely exists the Customer table (I've checked with IBExpert - in that I can read the data). I hardly found anything on Google.
Firebird 2.5 server is running on my Computer. What could be the problem?
原文:https://stackoverflow.com/questions/37369281
最满意答案
你快到了。 打电话给
Application.Run("macroname")
,你应该没问题。 确保macroname
位于Excel工作簿中的VBAModule
中并具有Public
范围。filename = './sampleWorkbook'; Excel = actxserver('Excel.Application'); workbook = Excel.Workbooks.Open(filename); Excel.Application.Run("macroname");
以下是
Application.Run
MSDN文档的链接: https : //msdn.microsoft.com/en-us/library/office/ff197132.aspxYou are almost there. Make a call to
Application.Run("macroname")
and you should be fine. Make suremacroname
is in a VBAModule
in your Excel Workbook and hasPublic
scope.filename = './sampleWorkbook'; Excel = actxserver('Excel.Application'); workbook = Excel.Workbooks.Open(filename); Excel.Application.Run("macroname");
Here is a link to MSDN documentation for
Application.Run
: https://msdn.microsoft.com/en-us/library/office/ff197132.aspx
相关问答
更多-
如何在MATLAB中向excel工作簿添加3张以上的工作表(How to add more than 3 sheets to an excel workbook from within MATLAB)[2024-03-23]
我不知道Matlab,但如果wb.Sheets.Item(wsheet).Activate();我会感到惊讶wb.Sheets.Item(wsheet).Activate(); 实际上是添加任何新的工作表。 很可能是在wb工作簿中选择/激活每个工作表,而默认的Excel模板有三个工作表。 因此,当它达到三个以上时,它会出错。 像这样的东西可能会添加一个新的Excel工作表: wb.sheets.Add(); I don't know Matlab but I would be surprised if w ... -
通过Matlab打开MS Excel(Open MS Excel by Matlab)[2022-05-21]
打开(但不关闭)Excel文件的最简单方法是使用WINOPEN : winopen('myFile.xlsx') The simplest way to open (but not close) an Excel file is to use WINOPEN: winopen('myFile.xlsx') -
您无法在MATLAB中直接导入公式。 MATLAB无法理解它们。 我认为最好的解决方案是重写所有公式,这是因为MATLAB可以非常快速地处理大量数据,而Excel则不能。 在MATLAB中导入数据( 而不是公式! )的快速解决方案是以CSV格式导出文件,然后使用csvread函数读取它们: http : //www.mathworks.it/it/help/matlab/ref/ csvread.html yourData = csvread(filename) 注意:谷歌搜索你可以找到一些很好的解决方案 ...
-
CSV中的Excel宏(Excel Macro in CSV)[2022-08-13]
虽然你不能将一个宏保存在一个CSV文件中,但你也可以 使用控制器工作簿或插件在CSV上运行宏 更进一步并以编程方式将代码添加到CSV文件(例如添加事件处理程序) 如果您提供了更多关于您需要做什么的信息,那么我们可以帮助您解决上述问题。 ( 编辑:它仍然不清楚如何生成CSV文件 - 这是通过Excel或其他应用程序?] 使用Pearson的应用程序事件示例,您可以使用底部的代码(从打开的Excel控制器工作簿中获取)添加新的CSV文件,然后对其进行格式化。 如果您需要赶上创建CSV文件,那么需要使用更复杂的方 ... -
对于这种东西,您可以直接转到Microsoft文档。 这些应该可以帮到你: http://msdn.microsoft.com/en-us/library/office/ff841185.aspx http://msdn.microsoft.com/en-us/library/office/ff198017.aspx 基本上,您可以在此处发出命令,就像在Excel GUI中的SaveAs对话框中一样。 For this kind of stuff, you can directly go to the Mi ...
-
这是由于Excel中的运算符优先级,其中-2^2 = (-2)^2 = 4 ,而在MATLAB中为-2^2 = -(2^2) = -4 。 因此在Excel中的-(40-F6*A6)^2是(-(40-F6*A6))^2 ,在MATLAB中是-((40-F6*A6)^2) 。 That is due to the operator precedence in Excel, where -2^2 = (-2)^2 = 4, whereas -2^2 = -(2^2) = -4 in MATLAB. Hence ...
-
在Excel宏中的Vlookup(Vlookup in Excel Macro)[2023-06-17]
尝试这个: Private Sub Save_Click() Dim RowCount As Long Dim myValue As Variant Dim Sh2 As Worksheet, Sh2 As Worksheet Dim RefRange As Range With ThisWorkbook Set Sh2 = .Sheets("Sheet2") Set Sh3 = .Sheets("Sheet3") End ... -
我在这里看到了几件事:带有一个输出的xlsread为您提供了双精度数字矩阵(不是单元格数组)。 因此,您应该使用()而不是{}来处理条目。 当我们使用4x4375来创建尺寸为4x4375的矩阵时,可以省略for循环。 我们直接用mean (在第一维度上评估)计算每列中4个值的mean 。 为了再次获得列向量,我们必须使用'转换mean的结果。 这是代码: g = xlsread('Data.xlsx',1,'E1:E17500'); y = mean(reshape(g,4,[]),1)'; xlswrit ...
-
Excel宏非VBA(Excel macro non VBA)[2022-02-03]
这是一个旧的Excel 4宏,从之前有一个VBA编辑器。 最新的Excel版本仍然支持它 - 右键单击Excel工作簿中的“工作表选项卡”,点击“插入”,对话框中的一个选项是插入MS Excel 4.0 Macro 。 选择它,它将插入一个看起来像工作表的工作表,但允许这样的宏。 有关迁移它们的一些有用链接: 使用Excel 4.0宏 和: 将Excel 4宏迁移到VBA 如果您想尝试使用Excel 4宏,可以在此处获取帮助文件(来自Microsoft)。 It's an old Excel 4 macro ... -
你快到了。 打电话给Application.Run("macroname") ,你应该没问题。 确保macroname位于Excel工作簿中的VBA Module中并具有Public范围。 filename = './sampleWorkbook'; Excel = actxserver('Excel.Application'); workbook = Excel.Workbooks.Open(filename); Excel.Application.Run("macroname"); 以下是Applic ...