ADOConnection->Open()的问题.大家帮忙急!

shuibing 2003-10-16 02:41:31
我用ADO连接的数据库
AnsiString mmpath=ExtractFilePath(ParamStr(0));
..

//中间有用SelectDirectioy
...
ADOConnection->Close();
ADOConnection->ConnectionString="FILE NAME="
+mmpath+"data.udl";
ADOConnection->Open(); //报错,找不到数据库,路径变成了我用SelectDirectioy//选择的目录.
各位高手我应该怎么解决啊?谢谢!
...全文
47 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
mabc 2003-10-17
  • 打赏
  • 举报
回复
查看下路径是否正确!
我不懂电脑 2003-10-17
  • 打赏
  • 举报
回复
调式一下,看看连接字符串有没有问题。
xc2927 2003-10-17
  • 打赏
  • 举报
回复
学习
ljianq 2003-10-17
  • 打赏
  • 举报
回复
看看到底是不是被修改了。

还有,直接使用ADOConnection->ConnectionString="FILE NAME="
+ExtractFilePath(ParamStr(0))+"data.udl";

何必去使用个变量。

shuibing 2003-10-17
  • 打赏
  • 举报
回复
SelectDirectioy更改了路径
所以open的时候找不到数据库,如果在udl文件中写数据库的绝对路径就可以了.
其实有个函数:setCurrentDir可以解决.
huangjuliang 2003-10-16
  • 打赏
  • 举报
回复
是不是对路径做了修改?
查一下路径
看看!
52vc 2003-10-16
  • 打赏
  • 举报
回复
mmpath+文件名
domustdo 2003-10-16
  • 打赏
  • 举报
回复
是不是中间有用SelectDirectioy对mmpath进行了修改,所以找不到数据库
1 , datafile.zip
"This sample demonstrates how to do file input and output using Visual Basic. The sample creates a new database file and allows you to view, add, or delete records in this database."
2 , dbprint.zip
This demonstrates how to print data from a database.
3 , edittbls.zip
This is an EXCELLENT example on how to edit database Tables through VB.
4 , graphdb.zip
This demonstrates how to graph information from a database to a picturebox.
5 , ClassBuilder1.zip
Class Builder - reads SQL Server or Access database and creates a class of the selected table
6 , adoView1.zip
ADO viewer. Retrieve all columns, querys and fields of a database and put them in a TreeView(using OpenSchema ADOConnection method)
7 , imagechunk1.zip
This application will save JPG,BMP,GIF files in your database and allows you to fetch the same. Code example for saving and fetching the same in oracle and sql is also given.
8 , DBImpExp.zip
A utility to import/export Access database from/to other application formats, e.g. Excel and text files. With sample files and help, as well as ample remarks.
9 , pb_test.zip
Test project illustrating high performance Data Access for SQL Server using ADO command objects and Stored Procedures for Insert, Update, Delete and Select. Two methods for Selects are shown
10 , Employees.zip
This is a database project, for storing employees data.
11 , DBProject2.zip
New version of DBProject. Allows you view, scroll through, and edit an access database.
12 , adoview.zip
ADO Viewer,This code retrieve all columns, querys, fields of a database(Access, SQL Server, etc...)
13 , Cheques2.zip
New version of Cheques program. Must see...
14 , ADOSQLcodeGenerator.zip
SQL and ADO Code Generator. Generate SQL statement and ADO Code Connection without the use of an ADO Data Control.
15 , client.zip
This application is about programming with Client Side Cursors.
16 , AccessSecurity.zip
An Access97 security tool. Replaces going into Access97 and switching between security forms.
17 , DatabaseViewandEdit.zip
Do about anything with Access databases. View, edit, export contents to Word or Excel, etc., etc.
18 , VBSales.zip
This is a complete database program for sales which help you to create purchase order, Invoice, etc.
19 , accidents.zip
A programme meant to add, edit,delete,and searching data. It includes how to show statistics regarding the accidents information.just try it. It is handy in studying database programming.
20 , MySQLExplorer.zip
Explorer for MySQL Data Base.You can retrieve and execute your query.
21 , ICDBaseSource115.zip
DAO based database program with many features in it
22 , ICDBSourceBeta115.zip
teach people just beginning with databases and also i am new to databases so this is pretty well commented.
23 , Diary.zip
This application everything you need.t has a CALCULATOR.It has TIME & DATE u can even set the system time
24 , L_datab.zip
The functions are for open Databases including passwords, creating Recordsets , executing SQL statements, renaming tables and many more.
25 , CodeGen.zip
VB code generator,The application currently generates data classes for Access '97 databases.
26 , dbexample.zip
The best part about using a MS JETDB EnGINE4 is that the DB can be accessed through a network.
27 , ComboLookup.zip
Zip Code Database Is A Program To Find Zip Codes By Using A Lookup Field.
28 , UDL.zip
This is a class that lets you create and edit UDL files
29 , qbd-dbCoder131.zip
This code shows how to take data from a VB database application and place it into an Excel spreadsheet.
30 , Family_v2_upload_Apr_05_2000.zip
This is a family address book program created using VB6.
31 , datsearch.zip
Application which searches an Access database for a specified search term entered by the user.
32 , DBTextGrid.zip
This program is the modification of my previous Textgrid.Now you can Add, Modify, Delete, View, Save data to/from your database with this Grid. The grid was formed with array of text boxes.
33,txtgrid.zip
This program creates text box array dynamically and loads the database fields onto it.
34,DAOLike.zip
This program Demonstrates how to use LIKE operator in Jet SQL Query (uses DAO).
35,xmlcreator.zip
This project is a demonstration of how to convert a recordset into an XML format file. Its well documented and more XML stuff to come along.
36,compmdb.zip
This program will allow the user to select a MDB file to compact. Its then backed up just in case, compressed and then the original is deleted before the new compacted version is moved back in place of the original.
37,dbinfo.zip
We've written this mainly for when we develop databases, but really you could adapt it for productive use too. By supplying a DSN entry, it will attempt to connect to that database and list all the tables in it. When you click on a table, it lists all
38,3a.zip
An Inventory System, you can add, edit, sort, find, delete, print, change your password and create a backup of your database
39,A417Source.zip
Full original RANDOM DATA INDEXING (SY-32)METHOD),Faster DATA access than a classical database application. the 1st source of new indexing method (SY-32)
40,student.zip
This is Student Administration Project , u can administrate student through this programme in any institute when u run the programme please use password "mars3" then u can run please check it.
41,ADOViewer.zip
ADO DataBase Viewer. Can open multiple concurrent databases from seperate providers. Works with Access, SQL Server and DSN. I included the ODBC Logon from VB6 so it should be able to hook up to any data provider that supports ADO.
42,rptparam.zip
Passing parameters with data reports. I have set two parameters and passed them during run time.Open with VB6.
43,CompactRepair.zip
A small application that shows you how to compact and repair a Microsoft Access mdb or mde using ADO (JRO).
44,Ledgerinvb5.zip
This is simple GL ledger Project, again a database program. It has an interesting part if you click About button. Must see it.
45,AdoSort.zip
Ado Data Sort Control will display your data from database, filter, sort (up to 3 levels) all in HFlexGrid!!!
46,adoxml.zip
Use ADO to convert database records into an XML file. All users must have MSXML.dll version 3.0, and Internet Explorer 5.5.
47,DataCntl.zip
Simple application that shows how to use the Data Control to connect to the Biblio.mdb database and display all authors in the Authors table.
48,MyTool.zip
An SQL Query tool for SQL Server or Oracle.
49,fab15.zip
Complete Database Address book With Lots Of New Facilites.....下载 Now.
50,DataBaseViewer.zip
DataBase Viewer is a program that lets you to look at your database files. It opens the recordsets in a table for easy viewing and also has a percents and progress bar to show the exact loading progress of the RecordSet.
51,Dynarep.zip
This program generates a dynamic datareport during runtime without using any DataEnvironment object. I have passed the datasource and recordset properties during run time. Opens with VB6.

52,EditUDL2.zip
This is a newer version of the Edit UDL class. This version 2.3 enables you to Create, Edit and Save UDL files either by the UDL properties Dialog Box or by a connection string. The class adds some additional Properties. The Zip file contains not only the class but a sample project demonstrating the use of the UDL class.
53,ADOclient-side.zip
In a network environment, open a connection to a database, retrieve data, close the connection, work with the data, reopen the connection to communicate with the database again and do a batch update.
54,udl2.zip
This application reads universal data link files from disk, creates them, and saves modifications to them to a file. UDL files contain ADO connection information to data sources. Their output can be used as a connection string in your applications.
55,timebilling.zip
This is a full 3-tier dababase application which includes a activex dll project(business objects) and a standard exe(UI).
56,ADODAOpw.zip
Application which shows how to access a password protected Access database using DAO and ADO.
57,DBExplorer.zip
Database explorer for viewing all tables and queries in a database. Also includes an SQL editor similar to SQL Query Analyzer.
58,FriendsDb.zip
ADO Database, Improved login and made the program smaller but with the same options as before just a few extra ones with the login such as write the login to the registry instead of just to a ini file also better encryption for the ini file... Now you can save your password as a number, in the previous login the encryption was poor.
59,FriendsDb105.zip
ADO Database... FriendsDatabase Version 1.05 ... Updated Again, Added even more error handling and images to the listview box also added a few forms to stay on top. Some major error additions i skipped before, runs much smoother now not that it didn't before.
60,Friends.zip
GREATLY UPDATED: Added much better error handling just to be safer and more neat... Also added more sound so all commands have a sound and upon loading a 3 second wav plays also included is the advanced progress bar and ocx that i found in someone elses source that is great for multiple reasons..
61,FriendsDatabase.zip
My first ADO database, i learned from tutorials on here specifically from Jerry Barnes so i think this would be great for people new to ADO databases to learn from but i suggest finding Jerry Barnes ADO For beginners source because it is incredibly commented on and will surely have you creating ADO within 20 minutes.
62,user_query.zip
The Application basically allows you to connect to any Access Database view records of each table, along with the table design ,write sql statements on the fly(any dml statement).Most Of The Functionality Of The Application Has Been Automated. A must See..
63,Database.zip
Database application. Must see...
64,Cheque.zip
Cheques. Must see...
65,ICDBaseSource.zip
DAO based database program with many features in it, I also noticed after searching around I seen no databases that supported saving gaming info so I made one witht he ability for saving game info such as favorite game, gaming handle, clan name, clan rank...
66,pizza.zip
Pizza Program. Must see...
67,prjDataEnv.zip
This VB database application shows how to use DataEnvironment in code.
68,Familyv3.zip
This is new version of a family address book that I released some time ago. This time around I mostly use ADO instead of DAO and now the user isallowed to add or remove any category of their choice.
69,AgendaRBC.zip
An Agenda which uses a text database file.
70,project26.zip
Stocks Portfolio.
71,vbasics.zip
This is a database project that uses the VB DBGrid control to display and scroll through all records in an Access database.
72,vbWales.zip
Database app. I did as a college assignment. Only simple stuff but there is some good tab strip code etc...
73,DBProject.zip
Database Viewer application. Allows you to view and scroll through all of the records in a database.
74,dbCoder.zip
Access97 Database Coder. Analyses a database and writes the code required to create blank copy. Two projects dbCoderAddIn.vbp can be compiled as an add-in and will place the code in a new module of the active project.
75,move_vb6.zip
Demonstrates how to use the data control to move through a recordset.
76,ado.zip
Opens an access database using ADO and then displays all records, provider properties and error information in a list box.
77,f_119.zip
An example of a bound form using the ADO control(4KB)
78,f_118.zip
Examples of a connectionless recordset(2KB)
1 单元 每个单元只包含一个类的声明。类中不永许写类的实现,类成员函数不超过20个,需要被外界调用的成员函数放在Public外,其余的全部放在Proteced,明确的不想让继承者修改的话放在Private中。 包含的头文件 也就是#include 在头文件应该包含该类所需要的类型的。如果cpp也包含了,那么头文件就不要在包含,使用Class vcl; 告诉头文件有些需要的已经在CPP文件中包含啦!另外对不再使用的包含文件要及时的清除出去,否则可能碰到连接出错的问题,bcb的连接提示少的可怜啊!就有苦头吃拉!还有要记得给自己加进的包含写注解啊!! 2 实现文件中 千万不要定义全局变量和全局函数,至于会发什么问题啦,只有碰到了几十万的代码,五六个项目集合,一两百个单元所可能发生的问题。 那该怎么办了? 简单把它归到所在单元的类声明中去。函数的实现代码行不要超过200行 包括之间的空格.因为人的暂时记忆能力不强啊! 为什么文章要分段落啊! 就是人暂存上下文的关联的内存是有限的呀 3 组件的属性设置和数据库的字段表名: 一般下都会在对象检查器中的设置。当调试过不去而你又忘记了设置的属性时的哭相,是多么地可气啊!而且BCB没有组件之间的比较,否则的话可以拖个同样的新组件来比一比到底哪里设置的不同! 所以没有办法只好麻烦些直接在代码中设置吧! 虽然很麻烦 却可以节省比较可观的时间呀! 要不就像 kateboy (老公)由于设置了ADOConnection 的Attrib里中的自动事务处理。每当退出程序时就报错!从早上跑到各大BCB的QQ群中求人帮助,只到最后吃晚饭才惊奇发现了毛病所在! 还有一次不知那各BCB老大自报家丑 说自己吸了5包烟抓改BUG直到凌晨时分,方发现了它,原来是书写错误。

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧