毕业设计网
毕业设计论文 | 毕业设计任务书 | 计算机外文翻译 | 文献综述 | 机械模具类 | 课程设计 |

电路交换网与vb调用数据库


               电路交换网与vb调用数据库
   
切换电路的连接设置的结果是保留了从发送端到接收端的包所通过的线路带宽。其它的特性这一就是所有的包都沿同一个线路意味着如果包传输超过了时序那它将不能到达接收端.由于没有路径用来进行包交换,所以要想不同的包沿不同的路径传送就是能依靠网络的条件了。这样包即便是超过了时序它们也有可能到达的。
包交换技术比线路交换技术更能容错。事实上,这也是它被发明的理由!当一个交换开头被拉下,则所有使用它的线路将被切断并且其余的包将不能再被传送。此时如果在进行包交换,包将在已选择的路径上停止交换。
预先建立一条路径也开创预先保留带宽的可能性。如果带宽被保留,那么当一个包到达时,通过保留的带宽它可以被立即发送出去。假如没有带宽被保留用于包交换,那么所有的包将不得不等待着被转发。
预先保留带宽意味着当一个包出现时不会发生拥塞(除非出现的包比预期的还多)。在另一方面,当尝试建立一条电路时,由于拥塞,尝试将会失败。因此,在线路交换(在设置时)和包交换(在包发送时)的不同时间拥塞都可能发生。
如果为特定的用户建立一条线路那么当这个用户没有数据传送时,则这些保留下来的带宽将被浪费而不能用于其它用户的传输。而包交换则不会浪费带宽,因此它在系统宽带方面的应用更有前景。理解电路交换和包交换的这种商业差别是极其重要的。这种商业差别是在质保服务和浪费资源相对不质保服务和不浪费资源的。
包交换是利用存储器并向前发送的。包是先存储在路由器的内存里然后再发送到下一个路由器的。和电路交换一样信息位也是连续不断地通过导线传输的。存储转发技术增加了延迟时间。
另一个不同是电路交换是完全透明的。发送者和接收者可以使用他们想要的任一比特速率,格式和帧同步.这通信公司不知道也不关心这的。而在包交换中载体决定了基本的参数的。用一个简单比喻它们就像一个是公路一个是铁路。在以前,用户决定介质的大小,速度和特性。而后来这些都由通信公司做了的。这些都是透明的它允许声音,数据和传真共同存在于电话系统里。
电路交换和包交换的最后一个不同点是计费方式。电路交换的计费是按照传统的距离和时间的。比如移动电话除打国际电话外距离是不列入计算的,而时间也只是列入一个简单的计算(例:拔打2000分钟电话比1000分钟电话花费的多并且晚上或周末也比平时来得便宜)。时间对于包交换来说是没有问题的,但是传输流量却是个问题。ISPs为家庭用户的计费方式基于按一个月的流量的一半的,这是因为它们用得相对较少并且他们的顾客也很好理解这种计费方式。但是主干网络中心的收费是基于它们的流量的。这些不同列在图2-40里。
项目 电路交换 包交换
呼叫设置 需要 不需要
专用物理线路 是 否
每个包沿相同路径 是  否
包的到达中有规则的 是 否
是否会致命的崩溃 是 否
带宽利用 固定 动态分配
可能的时间堵塞 在设置时 在每个包时
可能浪费带宽 是 否
以存储转发进行发送 否 是
透明性 是 否
收费 按分钟 按包
图2-40:比较电路交换网络和包交换网络的不同
电路交换和包交换是两者都是非常重要的,我们将立即在详细的资料里提及并描述它们之间各种不同的技术。

2.6 移动电话系统
    传统的电话的系统将不能满足用户的大量增长(即有一天实现了终端到终端的光纤连接)。人类在进步,人们期望能在飞机上,汽车里,船上,足球场甚至在公园里跑步的时候也能打电话。在近几年人们更是期望能在更多的地方发电子邮件和上网冲浪。因此有很多的人关心无线电话技术。在下面的章节我们将用详细的资料来学习这些主题。
    无线电话可以分为基本的两种:无绳电话和移动电话(有时也叫蜂窝电话)。无绳电话设备是由痤机和听筒组成它们被安装在用户的家里。它们从不被应用于网络,所以我们没有办法做进一步的检测。取而代之,我们将把焦点放在在声音和数据通信上有广泛应用的移动系统上。
    移动电话经历了三个不同的发展阶段,每个阶段都有不同的技术:
1. 模拟声音
2. 数字声音
3. 数字声音和数据(互联网,电子邮件,etc.)
虽然我们主要讨论这系统技术,但是我们也有必要注意政府和市场对它的巨大影响。第一个移动电话系统是在美国由受美国国家联邦通讯委员会(FCC)委托的美国电话电报公司(AT&T)设计的。结果在整个美国就有了一个简单的(模拟)系统并且移动电话开始在加利福尼亚上市同时也在纽约得到应用。相反的,当移动电话来到欧洲时,由于每个国家都设计了自己的系统,所以结局很惨败。
当数字技术到来时,欧洲从前面的失败中吸收教训,政府和邮政制定了简单系统(GSM)的统一标准,因此移动电话在欧洲的任何一个地方都是通用的。此时,美国政府决定不把标准商业化因而它失去了数字市场。这个决定导致不同的设备生产商生产出不同的移动电话。结果现在美国有两不可兼容的数字移动电话在使用(加强了一家就会削弱另一家)。
即使美国拥有移动电话的所有权,但是在应用上欧洲要远远超过美国的。原因之一就是整个欧洲拥有相同的简单系统。然而更多的是由于美国和欧洲的基本电话数量不同。在美国移动电话和固定电话是共用的,因此对于用户没有办法区分(212)234-5678到底是固定电话(拨打是便宜的或者是免费的)还是移动电话(拨打是昂贵的)。为了使人们从使用电话中获益,电话公司决定为引入呼叫而花自己的钱制造移动电话。结果导致,很多人怕由于呼叫而收到一大笔帐单而不愿意买移动电话。在欧洲移动电话有特殊的区号(如800,900之类的数字),所以它很快就得到了认可。因而在一般的“叫方付费”的原则在欧洲也被应用于移动电话了(除国际电话分开收费外)。
在欧洲采用颁布广泛的已经付费的移动电话的影响巨大(超过同地区的75%)。移动电话可以在很多的商店里购买而不像购买收音机那样需要很多手续。谁付费谁使用,他们预先存入,比如20或50 euro并且在快用完的时候可以用PIN码进行再充值。结果在欧洲几乎所有的青年和小孩都有一个(预付费的)移动电话,这样他们的父母就可以准确的定位他们而不用去担心孩子们会用掉一大笔帐的。如果仅在偶而使用移动电话,那么它的使用是基本免费的因为这里有月租或者预先支付呼叫。

2.6.1 第一代移动电话:模拟声音
    移动电话充分体现了政治和市场的特征。让我们来看一下它的技术吧。它是从简单的系统开始的。在20世纪的初,移动无线电话被偶而应用于海上或军事通信中。在1946年,第一个基站被安置在St.Louis。这个系统被安置在高层建筑上,它使用一个简单的大的发送机并且有了用于发送和接收的简单的通道。像这样的系统称做被动式系统,从1950开始它就被安装在很多的城市了。可较验的收音机,出租车,警车还有电视也广泛采用这种技术。
  在1960年,IMTS(改良的移动电话系统)被发明。它仍然使用高达200瓦的发送器,发送器被安置在山上,不过此时已经有了两各不同的频率了,一种用来发送,另一种用来接收,所以这个呼叫按钮就可不要了。相比信号出站移动电话的信号入站是通过不同的通道的,因此移动用户不会互相听到(不像应用在出租车上被叫系统)。
    IMTS支持从150 MHz到 450 MHz的23条通道。由于通道太少,用户经常要等很长时间才能听到拔号音。也由于小山上的发送器的功率太大,为了不互相干扰邻近的系统不得不与它相距几百千米。总而言之,这有限的容量使用这系统有点不合实际应用。
VB6.0中的MSChart控件是一个功能强大的高级图表工具,拥有丰富的图表绘制功能,可显示二维和三维的棒图、区域图、线形图、饼图等多种常用图表。近日我为了在双击图表的某个区域时将与该区域相对应的数据库的内容在DataGrid控件上显示出来,遇到了许多困难,最后用一个自定义的变量SelectSeries解决了问题,具体方法如下:
  设数据库名称为“学生信息”,有一Access表“学生成绩”,其内容为一个班学生的考试成绩,包括学号、姓名、成绩3个字段,成绩字段格式是字符型,值为“优”、“良”、“中”、“差”中的一个。
  窗体Form1包括一个MSChart控件McScore,类型为二维饼图,用于显示每种成绩的学生数;一个ADO控件AdScore用于连接数据库;一个DataGrid控件DgScore用于以表格形式显示数据库内容。
  工作过程为:双击饼图的某个区域,则DgScore显示相应成绩的学生名单。
  代码如下:
  Option Explicit
  Dim SelectedSeries as Integer ′自定义变量
  Dim Rs() as String ′提取记录集用的字符串数组
  Private Sub Form_Load()
  ′设定DataGrid控件的数据源
  DgScore.DataSource=″AdScore″
  ′设定ADO控件的连接字串和初始的记录源,即显示内容
  AdScore.ConnectString=″Provider=Microsoft.OLEDB.3.51;Persist_Security Info=False;Data Source=学生信息″
  AdScore.RecordSource=″selet * from学生成绩order by成绩″
  AdScore.Refresh
  ′预设好提取记录用的SQL语句
  Rs(1)=″select* from学生成绩where成绩=″+Chr(34)+″优″+_Chr(34)+″order by成绩″
Rs(2)=″select *from学生成绩where成绩=″+Chr(34)+″良″+_Chr(34)+″order by成绩″
Rs(3)=″select * from学生成绩where成绩=″+Chr(34)+″中″+_Chr(34)+″order by成绩″
Rs(4)=″select * from学生成绩where成绩=″+Chr(34)+″差″_Chr(34)+″order by成绩″
End Sub
  Private Sub McScore_SeriesSelected(Series as Integer,MouseFlags as _Integer,Cancel as Integer)
SelectedSeries=Series
  End Sub
  Private Sub McScore_PointSelected(Series as Integer,DataPoint as_Integer,MouseFlags as
Integer,Cancel as Integer)
  SelectedSeries=Series
  End Sub
  Private Sub McScore_Db1Click()
  ′改变ADO控件的记录源并刷新
  Adoc1.RecordSource=Rs(SeletedSeries)
  Adoc1.Refresh
  End Sub 
---- VB做为快速应用开发(RAD)工具越来越得到开发人员的认可和接受。它对许多API(如ODBC API、SOCKET API等等)的封装使得编程变得简单起来。同时,它支持集成开发环境下的可视化、事件驱动、面向对象等编程特点。下面,我们谈谈在VB中调用存储过程的实现方法及其注意事项。

---- 我们知道,VB的数据库编程有许多种方法,比如直接用ODBC API编程,这种方法灵活、高效,程序员可以实现对数据库复杂的控制;也可以用VB中的数据对象,如RDO(远程数据对象)、DAO(数据访问对象)、ADO(ActiveX 数据对象),这种方法实现起来方便、快捷,但灵活性较差一些。由于存储过程在实现数据封装、隐藏以及代码的预编译、减少网络负载、维护方便等优点,所以被许多RDBMS和编程工具做支持。VB中的各类数据对象也提供对存储过程的支持。

---- 我们以ADO为例来说明其实现的步骤

---- 1. 创建、调试存储过程。你可以在数据库中也可以在其他外挂程序的支持下进行存储过程的创建和调试工作。本例中的存储过程代码如下(使用PUBS的MS SQL中的例子库 ):

CREATE PROCEDURE myprocedure
@job_id smallint,
@job_lvl tinyint
AS
SELECT *
FROM employee
WHERE job_id < @job_id
AND job_lvl > @job_lvl


---- 2. 在VB中生成一个新的工程,工程有一窗体,一个COMMAND(NAME:COMMAND1) 按钮,一个 MSFlexGrid(NAME:MSFlexGrid1)控件。
---- 3. 创建连接ADO connection;

---- 4. 创建命令ADO command;

---- 5. 创建参数并设置各个参数的属性;

---- 6. 执行ADO command;

---- 7. 对数据进行处理;MSFlexGrid显示查询到的数据

---- 8. 释放连接,退出程序。

---- 其中代码如下:

在窗体中声明以下变量:
Dim cnn1 As ADODB.Connection ‘连接
Dim mycommand As ADODB.Command ‘命令
Dim parm_jobid As ADODB.Parameter ‘参数1
Dim parm_joblvl As ADODB.Parameter ‘参数2
Dim rstByQuery As ADODB.Recordset ‘结果集
Dim strCnn As String ‘连接字符串

在窗体的LOAD事件中加入如下代码:
Set cnn1 = New ADODB.Connection
‘生成一个连接
strCnn = "DSN=MYDSN;uid=sa;pwd="
‘创建的系统数据源MYDSN指向PUBS数据库
cnn1.Open strCnn ‘打开连接
在窗体的UNLOAD中的加入代码如下:
cnn1.Close ‘关闭连接
Set cnn1 = Nothing ‘释放连接

在按钮中的代码如下:
Dim i As integer
Dim j as integer
Set parm_jobid = New ADODB.Parameter
Set mycommand = New ADODB.Command
' parm_jobid.Name = "name1"
this line can be ommited
parm_jobid.Type = adInteger ‘

 [page]


Electric circuit exchange network
and vb transfer database
   
The result of the connection setup with circuit switching is the reservation of bandwidth all the way from the sender to the receiver. All packets follow this path. Among other properties, having all packets follow the same path means that they cannot arrive out of order. With packet switching there is no path , so different packets can follow different paths, depending on network conditions at the time they are sent. They may arrive out of order.
Packet switching is more fault tolerant than circuit switching. In fact, that is why it was invented. If a switch goes down, all of the circuits using it are terminated and no more traffic can be sent on any of them. With Packet switching, packets can be routed around dead switches.
Setting up a path in advance also opens up the possibility of reserving bandwidth in advance. If bandwidth is reserved, then when a packet arrives, it can be sent out immediately over the reserved bandwidth. With packet switching, no bandwidth is reserved, so packets may have to wait their turn to be forwarded.
Having bandwidth reserved in advance means that no congestion can occur when a packet shows up (unless more packets show up than expected).On the other hand, when an attempt is made to establish a circuit, the attempt can fail due to congestion. Thus, congestion can occur at different times with circuit switching(at setup time) and packet switching(when packets are sent).
If a circuit has been reserved for a particular user and there is no traffic to send, the bandwidth of that circuit is wasted. It cannot be used for other traffic. Packet switching does not waste bandwidth and thus is more efficient form a system-wide perspective. Understanding this trade-off is crucial for comprehending the difference between circuit switching and packet switching. The trade-off is between guaranteed service and wasting resources versus not guaranteeing service and not wasting resources.
Packet switching uses store-and-forward transmission. A packet is accumulated. in a router’s memory, then sent on to the next router. With circuit switching, the bits just flow through the wire continuously. The store-and-forward technique adds delay.
Another difference is that circuit switching is completely transparent. The sender and receiver can use any bit rate, format, or framing method they want to. The carrier does not know or care. With packet switching, the carrier determines the basic parameters. A rough analogy is a road versus a railroad. In the former, the user determines the size, speed, and nature of the vehicle; in the latter, the carrier does. It is this transparency that allows voice, data, and fax to coexist within the phone system.
A final difference between circuit and packet switching is the charging algorithm. With circuit switching, charging has historically been based on distance and time. For mobile phones, distance usually does not play a role, except for international calls, and time plays only a minor role(e.g., a calling plan with 2000 free minutes costs more than one with 1000 free minutes and sometimes night or weekend calls are cheaper than normal).With packet switching, connect time is not an issue, but the volume of traffic sometimes is. For home users, ISPs usually charge a flat monthly rate because it is less work for them and their customers can understand this model easily, but backbone carriers charge regional networks based on the volume of their traffic. The differences are summarized in Fig.2-40.


Item Circuit Switched Packet Switched
Call setup Required Not needed
Dedicated physical path Yes No
Each packet follows the same route Yes No
Packets arrive in order Yes No
Is a switch crash fatal Yes No
Bandwidth available Fixed Dynamic
Time of possible congestion At setup time On every packet
Potentially wasted bandwidth Yes No
Store-and-forward transmission No Yes
Transparency Yes No
Charging Per minute Per packet

Both circuit switching and packet switching are important enough that we will come back to them shortly and describe the various technologies used in detail.

2.6 THE MOBILE TELEPHONE SYSTEM
The traditional telephone system(even if it some day gets multi-gigabit end-to-end fiber) will still not be able to satisfy a growing group of users :people on the go .People now expect to make phone calls from airplanes ,cars ,swimming pools ,and while jogging in the park .Within a few years they will also expect to send e-mail and surf the Web from all these locations and more consequently ,there is a tremendous amount of interest in wireless telephony .In the following sections we will study this topic in some detail.
Wireless telephones come in two basic varieties :cordless phones and mobile phones(sometimes called cell phones),Cordless phones are devices consisting of a base station and a handset sold as a set for use within the home. These are never used for networking ,so we will not examine them further .Instead we will concentrate on the mobile system ,which is used for wide area voice and data communication.
Mobile phones have gone through three distinct generations ,with different technologies:
1. Analog voice
2. Digital voice
3. Digital voice and data(Internet ,e-mail ,etc.).
Although most of our discussion will be about the technology of these systems ,it is interesting to note how political and tiny marketing decisions can have a huge impact .The first mobile system was devised in the U.S. by AT&T and mandated for the whole country by the FCC .As a result ,the entire U.S. had a single(analog) system and a mobile phone purchased in California also worked in New York .In contrast ,when mobile came to Europe ,every country devised its own system ,which resulted in a fiasco.
Europe learned from its mistake and when digital came around, the government-run PTTs got together and standardized on a single system(GSM),so any European mobile phone will word anywhere in Europe .By then ,the U.S. had decided that government should not be in the standardization business ,so it left digital to the marketplace .This decision resulted in different equipment manufacturers producing different kinds of mobile phones .As a consequence ,the U.S. now has two major incompatible digital mobile phone systems in operation(plus one minor one).
Despite an initial lead by the U.S. , mobile phone ownership and usage in Europe is now far greater than in the U.S. Having a single system for all of Europe is part of the reason ,but there is more .A second area where the U.S. and Europe differed is in the humble matter of phone numbers .In the U.S. mobile phones are mixed in with regular (fixed) telephones .Thus ,there is no way for a caller to see if ,say ,(212)234-5678 is a fixed telephone (cheap or free call) or a mobile phone (expensive call).To keep people from getting nervous about using the telephone ,the telephone companies decided to make the mobile phone owner pay for incoming calls .As a consequence ,many people hesitated to buy a mobile phone for fear of running up a big bill by just receiving calls .In Europe ,mobile phones have a special area code (analogous to 800 and 900 numbers) so they are instantly recognizable .Consequently , the usual rule of “caller pays” also applies to mobile phones in Europe (except for international calls where costs are split).
A third issue that has had a large impact on adoption is the widespread use of prepaid mobile phones in Europe (up to 75% in some areas ).These can be purchased in many stores with no more formality than buying a radio .You pay and you go .They are preloaded with ,for example ,20 or 50 euro and can be recharged (using a secret PIN code ) when the balance drops to zero . As a consequence , practically every teenager and many small children in Europe have (usually prepaid ) mobile phones so their parents can locate them ,without the danger of the child running up a huge bill .If the mobile phone is used only occasionally ,its use is essentially free since there is no monthly charge or charge for incoming calls .
2.6.1 First-Generation Mobile Phones :Analog Voice
    Enough about the politics and marketing aspects of mobile phones .Now let us look at the technology ,starting with the earliest system .Mobile radiotelephones were used sporadically for maritime and military communication during the early decades of the 20th century .In 1946, the first system for car-based telephones was set up in St.Louis .This system used a single large transmitter on top of a tall building and had a single channel ,used for both sending and receiver .Such systems ,known as push-to-talk systems ,were installed in several cities beginning in the late 1950s.CB-radio,taxis,and police cars on television programs often use this technology.
  In the 1960s,IMTS(Improved Mobile Telephone System) was installed .It ,too ,used a high-powered (200-watt) transmitter ,on  top of a hill , but now had two frequencies ,one for sending and one for receiving , so the push-to-talk button was no longer needed . Since all communication from the mobile telephones went inbound on a different channel than the outbound signals ,the mobile users could not hear each other (unlike the push-to-talk system used in taxis).
    IMTS supported 23 channels spread out from 150 MHz to 450 MHz .Due to the small number of channels ,users often had to wait a long time before getting a dial tone .Also ,due to the large power of the hilltop transmitter ,adjacent systems had to be several hundred kilometers apart to avoid interference . All in all ,the limited capacity made the system impractical.
In VB6.0 MSChart controls is one function formidable high-level graph tool, has the rich graph plan function, may demonstrate two-dimensional and the three dimensional good chart, the linear chart, the cake chart and so on the many kinds of commonly used graph. Recently I in order to in double struck the graph when some region will the database content which corresponded with this region controlled on in DataGrid demonstrates, encountered many difficulties, finally used one to solve the problem from definition variable SelectSeries, concrete method as follows:
Supposes the database name is " the student information ", has one Access table " the student result ", its content is one class student's test result, includes the student number, the name, the result 3 fields, the result field form is the character, the value is " is superior ", " is good ", " center ", " the difference " center one.
Window Form1 includes one MSChart controls MC$score, the type for the two-dimensional cake chart, uses in to demonstrate each kind of result the student counts; One ADO controls AdScore uses in to connect the database; One DataGrid controls DgScore uses in by the form form demonstration database content.
The work process is: Double strikes the cake chart some region, then DgScore demonstrates the corresponding result the student name list.
Code as follows:
Option Explicit
Dim SelectedSeries as Integer ' from definition variable
Dim Rs () as String ' withdraws the character string array which the record compendium uses
Private Sub Form_Load ()
' Establishes DataGrid controls the data pool
DgScore.DataSource= " AdScore "
' Establishes ADO controls the connection character string and the initial record source, namely demonstration content
AdScore.ConnectString= " Provider=Microsoftc.oledb.3.51; Persist_Security Info=False; Data Source= student information "
AdScore.RecordSource= " selet * from student result order by result "
AdScore.Refresh
' Supposes in advance withdraws the SQL sentence which the recording uses
Rs (1) = " select * from the student result where result = " + Chr (34) + " is superior " + _Chr (34) + " order the by result "
Rs (2) = " select * from the student result where result = " + Chr (34) + " is good " + _Chr (34) + " order the by result "
Rs (3) = " select * from student result where result = " + Chr (34) + " center " + _Chr (34) + " order by result "
Rs (4) = " select * from student result where result = " + Chr (34) + " difference " _Chr (34) + " order by result "
End Sub
Private Sub MC$score_SeriesSelected (Series as Integer, MouseFlags as _Integer, Cancel as Integer)
SelectedSeries=Series
End Sub
Private Sub MC$score_PointSelected (Series as Integer, DataPoint as_Integer, MouseFlags as
Integer, Cancel as Integer)
SelectedSeries=Series
End Sub
Private Sub MC$score_Db1Click ()
' Changes ADO controls the record source and renovates
Adoc1.RecordSource=Rs (SeletedSeries)
Adoc1.Refresh
End Sub
---- VB does for the rapid application development (RAD) the tool more and more obtains the development personnel's approval and accepts. It to many API (for example ODBC API, SOCKET API and so on) the seal causes the programming to change is simple. At the same time, it supports under the integrated development environment visible, the event actuates, to be object-oriented and so on the programming characteristic. Under, we chat in VB transfer the memory process the realization method and its the matters needing attention.

---- We know, the VB database programming has permits the many kinds of method, for instance straight takes over the use of ODBC the API programming, this method is flexible, is highly effective, the programmer may realize to the database complex control; Also may use in VB the data object, like RDO (long-distance data object), DAO (data visit object), ADO (ActiveX data object), this method realizes conveniently, quickly, but flexible worse somewhat. As a result of memory process in realization data merit and so on seal, hideaway as well as code pre- translation, reduced network load, maintenance convenience, therefore does by many RDBMS and the programming tool the support. In VB each 类数 also provides to saves the process according to the object the support.

---- We as regularly explain its realization take ADO the step

---- 1. Foundation, debugging memory process. You may also be allowed to hang the procedure in the database outside other under the support carry on the memory process the foundation and the debugging work. In this example memory process code is as follows (uses in PUBS MS SQL the example storehouse):

CREATE PROCEDURE myprocedure
@job_id smallint,
@job_lvl tinyint
AS
SELECT *
FROM employee
WHERE job_id < @job_id
AND job_lvl > @job_lvl


---- 2. Produces one new project in VB, the project has one window, one COMMAND (NAME: COMMAND1) button, one MSFlexGrid (NAME: MSFlexGrid1) controls.
---- 3. The foundation connects ADO connection;

---- 4. The foundation orders ADO command;

---- 5. The foundation parameter and establishes each parameter the attribute;

---- 6. Carries out ADO command;

---- 7. The logarithm according to carries on processing; MSFlexGrid demonstrates inquires data

---- 8. The release connects, withdrawal procedure.

---- Code as follows:

States below the variable in the window:
Dim cnn1 As ADODB.Connection ' connects
Dim mycommand As ADODB.Command ' orders
Dim parm_jobid As ADODB.Parameter ' parameter 1
Dim parm_joblvl As ADODB.Parameter ' parameter 2
Dim rstByQuery As ADODB.Recordset ' result collection
Dim strCnn As String ' connection character string

Joins the following code in the window LOAD event:
Set cnn1 = New ADODB.Connection
' Produces one connects
strCnn = \ " DSN=MYDSN; uid=sa; pwd=\ "
' Foundation system data pool MYDSN aims at the PUBS database
cnn1.Open strCnn ' opens connects
Joins the code as follows in window UNLOAD:
cnn1.Close ' the closure connects
Set cnn1 = Nothing ' the release connects

In button code as follows:
Dim i As integer
Dim j as integer
Set parm_jobid = New ADODB.Parameter
Set mycommand = New ADODB.Command
\' parm_jobid.Name = \ " name1\ "
this line can be ommited
parm_jobid.Type = adInteger '

 

 

 

 

 

 

 


[page][page] 

以上是一部分介绍,如需要完整的资料或者如不符合您的要求,请联系技术人员qq:242219979咨询

上一篇:考试系统-毕业论文免费的哦
下一篇:小区物业管理系统_中英文翻译


版权所有 毕业设计网联系qq:242219979 © 2007-2022