简体   繁体   English

Delphi,Microsoft Access 2007连接字符串

[英]Delphi, Microsoft Access 2007 Connection String

I've been trying to create a program that creates a database, creates tables, stores information in these tables, and reads off these tables. 我一直在尝试创建一个程序,该程序创建数据库,创建表,在这些表中存储信息并读取这些表。 I am using delphi and microsoft access (although I am open to using another database program if one is easier to learn). 我正在使用delphi和microsoft access(尽管我更愿意使用另一种数据库程序(如果更容易学习)。 Anyway, I cam across this question and answer: Delphi 7: ADO, need basic coding example 无论如何,我会遇到以下问题: Delphi 7:ADO,需要基本的编码示例

However I am confused about what my connection string would be or how to know what is is. 但是我对我的连接字符串是什么或如何知道是什么感到困惑。 I want the database saved in the same file area as where my program is so would it just be the file directory to that area such as: 我希望将数据库保存在与程序所在的文件区域相同的文件区域中,因此它将只是该区域的文件目录,例如:

FILE NAME=E:\\project\\Debug\\Win32\\Studentdb.accdb 文件名= E:\\ project \\ Debug \\ Win32 \\ Studentdb.accdb

Also the user uses +database. 用户也使用+数据库。 If my database name is Studentdb would I just put 'Brill1' in that space or not? 如果我的数据库名称是Studentdb,是否可以在该空间中放入“ Brill1”?

Also do I need to use ODBC connector if I am not using MYSQL? 如果我不使用MYSQL,是否还需要使用ODBC连接器? I am guessing not but do I need to use something else. 我猜不是,但是我需要使用其他东西。 Also, while saving files from microsoft access they save as .accdb however when I created a ADOConnection component on my form and pressed into the connection string property it was asking for a .udl and I haven't run across this anywhere before so I am wondering if I need to convert or do something with that. 另外,在从Microsoft Access中保存文件时,它们另存为.accdb,但是当我在窗体上创建ADOConnection组件并按入连接字符串属性时,它要求的是.udl,而我之前从未在任何地方运行过想知道我是否需要转换或做些什么。

I am a real beginner with this so I am sorry if my questions are obvious but I would really appreciate some help or pointed to a beginner's friendly resource on the subject. 我是一个真正的初学者,因此很抱歉,如果我的问题很明显,但我会非常感谢您的帮助或指出了初学者在该主题上的友好资源。 Thank you. 谢谢。

All possible connection strings from Access 2007 are here: Access 2007中所有可能的连接字符串在这里:

https://www.connectionstrings.com/access-2007/ https://www.connectionstrings.com/access-2007/

...which one to choose depends on which driver you have and/or want to use. ...选择哪一个取决于您拥有和/或想要使用的驱动程序。

(ACE, OLE, ODBC ...) (ACE,OLE,ODBC ...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM