Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Delphi + dBase через ADO, изменить разрядность поля 
:(
    Опции темы
Golden Hands
Дата 15.5.2006, 11:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Золотой
****


Профиль
Группа: Участник Клуба
Сообщений: 2023
Регистрация: 23.1.2005
Где: Екатеринбург

Репутация: 2
Всего: 83



Есть поле в dbf-файле типа Numeric определенного размера, с определенной разрядностью. Как возможно программно поменять разрядность? Работа через ADO (OLE DB для ODBC). 


--------------------
Мы обречены... но только на победу!
Настанет день, и мы построим новый дом.
Внесем в него тепло, что сохранить сумели,
И воскресим все то, что в нас когда-то умерло... © Тень Света
PM MAIL ICQ   Вверх
bas
Дата 15.5.2006, 11:59 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 446
Регистрация: 14.8.2002
Где: Молдова, Кишинев

Репутация: 1
Всего: 2



Код

alter table
 
PM MAIL   Вверх
Golden Hands
Дата 15.5.2006, 12:11 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Золотой
****


Профиль
Группа: Участник Клуба
Сообщений: 2023
Регистрация: 23.1.2005
Где: Екатеринбург

Репутация: 2
Всего: 83



bas, можно указать и разрядность? Приведи примерчик, если не трудно. 


--------------------
Мы обречены... но только на победу!
Настанет день, и мы построим новый дом.
Внесем в него тепло, что сохранить сумели,
И воскресим все то, что в нас когда-то умерло... © Тень Света
PM MAIL ICQ   Вверх
Golden Hands
Дата 15.5.2006, 16:01 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Золотой
****


Профиль
Группа: Участник Клуба
Сообщений: 2023
Регистрация: 23.1.2005
Где: Екатеринбург

Репутация: 2
Всего: 83



Создаю таблицу

Код

create table <table_name> (<field_name> numeric);


разрядность поля при этом устанавливается равной 5. Как указать ее явно?


 


--------------------
Мы обречены... но только на победу!
Настанет день, и мы построим новый дом.
Внесем в него тепло, что сохранить сумели,
И воскресим все то, что в нас когда-то умерло... © Тень Света
PM MAIL ICQ   Вверх
bas
Дата 15.5.2006, 16:19 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 446
Регистрация: 14.8.2002
Где: Молдова, Кишинев

Репутация: 1
Всего: 2



Код

alter table e735334 
     add v1 numeric(2,0),
     add amount1 numeric(16,5),
     add r_mfo1 numeric(9,3)



Добавлено @ 16:21 
Только выбери провайдера MS VFP DBASE or VFP - просто  DBASE будет глючить. 
PM MAIL   Вверх
Golden Hands
Дата 15.5.2006, 17:31 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Золотой
****


Профиль
Группа: Участник Клуба
Сообщений: 2023
Регистрация: 23.1.2005
Где: Екатеринбург

Репутация: 2
Всего: 83



bas, конечно же я пытался сделать так. Нельзя задать длину Numeric - ругается на ошибку в команде. 
А это где ты такого провайдера выискал?  smile  


--------------------
Мы обречены... но только на победу!
Настанет день, и мы построим новый дом.
Внесем в него тепло, что сохранить сумели,
И воскресим все то, что в нас когда-то умерло... © Тень Света
PM MAIL ICQ   Вверх
bas
Дата 15.5.2006, 18:54 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 446
Регистрация: 14.8.2002
Где: Молдова, Кишинев

Репутация: 1
Всего: 2



Цитата(Golden Hands @  15.5.2006,  17:31 Найти цитируемый пост)
Нельзя задать длину Numeric - ругается на ошибку в команде. 

Какая ошибка? Хотя не надо Driver={Microsoft dBase Driver (*.dbf)}
всеравно не поймет и будет ставить 5, поиграйся с float,DECIMAL - у меня так и не получилось пока не перешел на-
Driver={Microsoft dBase VFP Driver (*.dbf)}
DRIVER=Microsoft FoxPro VFP Driver (*.dbf)
DRIVER=Microsoft Visual FoxPro-Treiber

Последний даже ntx,idx поддерживает.

Добавлено @ 18:55 
Цитата(Golden Hands @  15.5.2006,  17:31 Найти цитируемый пост)
А это где ты такого провайдера выискал?     

Бывает smile    

Это сообщение отредактировал(а) bas - 15.5.2006, 19:03
PM MAIL   Вверх
bas
Дата 3.7.2006, 11:47 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 446
Регистрация: 14.8.2002
Где: Молдова, Кишинев

Репутация: 1
Всего: 2



Цитата

  -----------------------------------------------------------
  Microsoft® Visual FoxPro™ ODBC Driver Version 6.0a
  -----------------------------------------------------------

  © Copyright Microsoft Corporation, 1998
   
Release Notes
September 19, 1998

Welcome to this release of the Microsoft® Visual FoxPro™ ODBC Driver! Please read this important information.
System Requirements

------------------------
How to Use This Document
------------------------

To view the ReadMe file in Windows Notepad, maximize the Notepad window, and click Word Wrap on the Edit menu. To print the ReadMe file, open it in Notepad or another word processor, and then use the Print command on the File menu.

--------
CONTENTS
--------

1.   INSTALLATION NOTES
     1.1  System Requirements
     1.2  What's New in this Release
     1.3  Installing the Driver
     1.4 Adding a Data Source
     1.5 Help Files
     1.6 Naming Conventions

2.   Supported Areas  
     2.1 Language Support
     2.2 ODBC 3.5 Compliance
     2.3 Referential Integrity
     2.4 Thread Support
     2.5 dBase® Support
     2.6 International Support

3.   UnSupported Areas

4.   Known Issues

5.   Troubleshooting

6.   Books


1.1  System Requirements
========================
To install the Visual FoxPro ODBC Driver, you need:
 * Windows NT 4 (or later.  Service Pack 5, recommended), 
     Windows 95, or Windows 98 (or later).
 * 2 megabytes disk space.

Important: Visual FoxPro ODBC Driver is a 32-bit driver only.  Windows 3.1 and Windows for Workgroups platforms are not supported. 

1.2  What's New in this Release
=========================
*  The initial setting for SET REPROCESS is changed to 5 so that Visual FoxPro tries to lock a record for a limited number of times. If the attempted lock fails, Visual FoxPro generates an error.


1.3  Installing the Driver
=========================
To install the Visual FoxPro ODBC Driver, run SETUP.EXE.

Note:  The Visual FoxPro ODBC Driver installation updates the ODBC components to ODBC 3.51 compliance if necessary. See the ODREADME.TXT file in your Windows system directory for additional information on enhancements or features of the ODBC 3.51 components.


1.4  Adding a Data Source
=========================
After installing, define a data source:
1. In Control Panel, double-click the 32-bit ODBC icon.
2. Click Add.
3. Select Microsoft Visual FoxPro Driver.
4. In the ODBC Visual FoxPro Setup dialog box, enter a data source name.
5. Select either Visual FoxPro database (.DBC) or Free Table directory.
6. Enter the name of the database or the path to the free table, or click Browse.
7. Click OK, and then click Close.


1.5  Help Files
==========================
The Visual FoxPro ODBC Driver comes with two help files, located in the SYSTEM directory on Windows 95 or the SYSTEM32 directory on Windows NT:

* ODBCINST.HLP - General ODBC information which contains information on:
*   The ODBC Driver dialog box
*   The options that can be set in the drivers dialog box in the Control Panel
* DRVVFP.HLP Visual FoxPro ODBC Driver Help file which provides information on:
*   Installing and Configuring
*   Using the Visual FoxPro Driver
*   Technical Reference
*   ODBC API
*   Visual FoxPro Language Reference
*   Error Messages


1.6  Naming Conventions
==========================
The Visual FoxPro ODBC Driver names columns based on expressions. For example, if you execute the following statement:

    SELECT MIN (customer_id) FROM customers

the Visual FoxPro ODBC Driver returns min_customerid as the name of the column in the result set.
If you would like to control the resulting field name, use the AS clause, as in this example:

SELECT MIN(customer_id) AS minimum_custid FROM customers 


==========================
2.  Supported Areas
==========================
The following section describes areas of particular support by the Visual FoxPro ODBC Driver.

2.1  Language Support
==========================
Supported Versions of FoxBase+ and FoxPro Tables
The Visual FoxPro ODBC Driver gives you access to Microsoft® FoxBase+®, FoxPro 1.x, FoxPro 2.x and Visual FoxPro tables. Also, the Visual FoxPro ODBC Driver allows you to access tables that are in a Visual FoxPro database container (.DBC file).

Note   The Visual FoxPro ODBC Driver only allows transactions on tables within a Visual FoxPro database (.DBC file), not free tables.


2.2  ODBC 3.51 Compliance 
==========================
The Visual FoxPro ODBC Driver is ODBC Level 1 API compliant and also implements several Level 2 APIs. All supported APIs have been implemented at this time. Please report any problems you find regarding the APIs. The Help file, DRVVFP.HLP, documents supported functions and acceptable input parameters. In addition, Visual FoxPro SQL extends the SQL functionality available through the driver. See the Visual FoxPro Language Reference for the extended grammar.


2.3  Referential Integrity Support
==========================
The Visual FoxPro ODBC Driver supports Visual FoxPro rules, triggers, and default values, provided they contain functions that are supported by the driver. See the Help file, DRVVFP.HLP, for details on which Visual FoxPro 
language elements are supported.


2.4  Thread Support
==========================
The driver is thread-safe. The Visual FoxPro ODBC Driver can process queries in the background. However, you should disable this feature if the driver is being called by a multi-threaded application. For more information, see the "ODBC Visual FoxPro Setup Dialog Box" Help topic.

Remote Views and Parameterized Views
Any time SQLTables( ) is called, remote and parameterized views are excluded from the list. Local views based on parameterized views are not excluded, but will generate errors if you use them. If you call SQLTables( ) with a unique table name, however, you will find views (if they are present) so you can check for name conflicts.


2.5  dBase® Support
==========================
Supported Versions of dBASE® IV Tables
The Visual FoxPro ODBC Driver gives you access to dBASE® 4 and earlier tables.
The dBASE® files are supported in the following manner:
* dBASE® v2.x and 3.x: The files are read without conversion.
* dBASE® v4.x and 5.x: If the files do not have memo fields and the table has fewer than 255 columns, the files are read.

Caution   If a dBASE® v4.x or 5.x file has associated index files (.MDX, .NDX), the Visual FoxPro ODBC Driver will not update the file properly and the indexes will be corrupted. These files should be accessed read-only.

* dBASE®  v4.x and 5.x tables with memo fields: These files require conversion in the full Visual FoxPro for Windows product before using them with the Visual FoxPro ODBC Driver. The driver will not read or convert files.


2.6  International Support
==========================
* The driver is DBCS enabled.
* You can now set the collating sequence for index ordering. The list of supported collating sequences can be found in the description of SET COLLATE in the Visual FoxPro Language Reference Help topic.

The default collating sequence is "MACHINE". The collating sequence can be changed by executing either a SET COLLATE TO Language with the ODBC C API SQLExecDirect( ), by calling SQLPrepare( ) and SQLExec( ) (see the ODBC SDK Reference manual p. 42-44), or by selecting a different collating sequence from the driver options in the Data Source Setup dialog.

Note   The FOXPRO.INT file is installed in the system directory. If it is removed, the collating sequences on Eastern European code page machines will not work.


==========================
3. Unsupported Areas
==========================
* Refresh is not supported in rules and triggers.
* The Help file describes the supported commands and functions and lists the unsupported commands and functions. Any command or function not listed in the Help file is not supported. 
* Parameterized views work in a trigger only if the parameter has been assigned a value before the view is opened. Interactive input of a parameter value is not allowed in ODBC.
* Remote views to other ODBC data sources are not supported by the Visual FoxPro ODBC driver; however, local views (non-parameterized) are fully supported.


==========================
4.  Known Issues
==========================
* If you insert, delete, or update a Visual FoxPro table via the Visual FoxPro ODBC Driver, you might get a "Trigger Failed" message. Check for unsupported commands in the trigger.
* INDEX ON is not supported in this release.
* If a table is opened exclusively and the same table is accessed by another user with SET EXCLUSIVE OFF, then the error "Option Value Changed" is returned by Visual FoxPro ODBC Driver instead of "File is in use by another."
* MSQuery returns a "Cannot Open File" error when creating a table with a field name that starts with a number. For example, the field name "1995 Sales" is not allowed. Visual FoxPro does not allow the creation of field names that begin with a number, but MSQuery does.


==========================
5.  Troubleshooting
==========================
If you have trouble installing the driver, try the following and then try to reinstall again:

1. Clean-boot the machine. For example, under Windows 95, start in Safe Mode.
2. Close all other applications, including virus software, third-party shells, or toolbars such as Microsoft Office Manager.
3. If the computer has video or system ROM shadowing, disable these options before reinstalling.
4. Check that the .EXE file is not corrupted.

If you are still having problems:
* Make sure that you are running on a clean configuration when testing issues.

* Use the Microsoft ODBC Data Source Administrator control panel Tracing tab to help determining the cause of problems.

* Check to see if the latest build of the driver is installed. To view the version:

1. In the ODBC Data Source Administrator control Panel, double click the 32bit ODBC icon.
2. Click on the ODBC Drivers tab.

* You can generate an ODBC Trace Log by using the ODBC Data Source Administrator control Panel:

1. In the Control Panel, double click the 32bit ODBC icon.
2. Select the Tracing tab.
3. Specify a When to trace option.
4. Specify a log file name.
5. Click Start Tracing Now.

Now, when you execute your code, all the C ODBC API calls, their input parameters, and their output are written to the log file. The ODBC log file is ASCII text that you can view in any standard ASCII text editor such as Word, Notepad, or WordPad. Occasionally, it might be necessary to include the trace log in a bug report. Since the ODBC trace log can be lengthy, copy only the last four or five function calls and paste them into a separate document before sending the bug report.


==========================
6.  Books
==========================
Microsoft ODBC 3.0 Programmer's Reference and SDK Guide (ISBN#: 1-57231-516-4 from Microsoft Press) provides basic reference information.

Inside ODBC (ISBN#: 1-55615-815-7 from Microsoft Press) provides a good background on the development of the ODBC specifications and a CD with ODBC code examples.

Database Developer's Guide with Visual C++ (ISBN#: 0-672-30613-1 from Sams Publishing) has several good C++ examples that use the ODBC API.



==========================


 
PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "Delphi: Базы данных и репортинг"
Vit
Петрович

Запрещено:

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами


Обязательно указание:

1. Базы данных (Paradox, Oracle и т.п.)

2. Способа доступа (ADO, BDE и т.д.)


  • Литературу по Дельфи обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • 90% ответов на свои вопросы можно найти в DRKB (Delphi Russian Knowledge Base) - крупнейшем в рунете сборнике материалов по Дельфи
  • Вопросы по SQL и вопросы по базам данных не связанные с Дельфи задавать здесь

FAQ раздела лежит здесь!


Если Вам помогли и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, Vit, Петрович.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Delphi: Базы данных и репортинг | Следующая тема »


 




[ Время генерации скрипта: 0.0894 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.