终止类库 [英] Terminate a Class Library

查看:77
本文介绍了终止类库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家早上好。



我正在与简单的事情作斗争。

我有很多程序可以打开任何4个Access数据库。每个程序都包含重复的代码,用于建立与适用数据库或数据库的连接字符串(一次一个连接)。



我的开发生涯中第一次我正在尝试编写一个类库,以便不需要重写(或复制和粘贴)所有这些代码。



部分要求是检查是否数据库在建立连接之前存在。



如果没有,则显示相关消息并终止类库。



And这是轮子脱落的地方。



看来END语句在类库中不起作用。



有没有办法提前终止类库,或者你是否更改逻辑并让流程进入逻辑结束?

Good morning everyone.

I am battling with what may be something simple.
I have a number of programs that open any of 4 Access databases. Each of programs contains duplicate code to establish the connection string to the applicable database or databases (one connection at a time).

For the first time in my development life I am attempting to write a Class Library in order to eliminate the need to rewrite (or copy and paste) all this code.

Part of the requirement is to check if the database exists before establishing the connection.

If it does not then show a message to that effect and terminate the Class Library.

And this is where the wheels come off.

It appears that an END statement does not work in a Class Library.

Is there a way to terminate a Class Library prematurely or do you change the logic and just let the process fall through to a logical end?

推荐答案

I我不确定你的意思是过早终止一个类库,但你可能会发现 http: //www.csunit.org/tutorials/tutorial6/ [ ^ ]有用。
I'm not sure what you mean by "terminate a Class Library prematurely", but you may find http://www.csunit.org/tutorials/tutorial6/[^] useful.


这篇关于终止类库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆