首页 \ 问答 \ 火鸟异常:表未知[重复](Firebird exception: Table unknown [duplicate])

火鸟异常:表未知[重复](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
更新时间:2023-09-26 11:09

最满意答案

你快到了。 打电话给Application.Run("macroname") ,你应该没问题。 确保macroname位于Excel工作簿中的VBA Module中并具有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.aspx


You are almost there. Make a call to Application.Run("macroname") and you should be fine. Make sure macroname is in a VBA Module in your Excel Workbook and has Public 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,但如果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 ...
  • 打开(但不关闭)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文件中,但你也可以 使用控制器工作簿或插件在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 ...
  • 尝试这个: 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 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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。