VB 2010 Advantage Database Example

Sybase Advantage Database With Visual Basic 2010

Update Sybase Advantage Database using XML file from Visual Basic 2010 [Client-Server] Idea.
Update Sybase Advantage Database using XML file from Visual Basic 2010 [Client-Server] Idea.
1. Create New VB2010 Windows Application Project
2. Path to Project (I.e. D:\MySyBase\)
3. Path to Database (I.e. D:\MySyBase\Bin\Debug)
4. Sybase Advantage Database (MyDB.add)
5. Sybase Advantage Database Username : AdsSys - Password : ahmed
6. Sybase Advantage Database Table (I.e. MyInfo.adt)
We will create a personal Info application, so the table structure will be like that :
Sybase Advantage Database
Visual Basic 2010 - Sybase Advantage Database
Note : All other fields will vary in [Size] only but all fields are [cicharacter] Data Type.

Visual Basic Form Deign :
Visual Basic 2010
Visual Basic Online Courses
Note : I have made TextBoxes with Naming convenient (I.e NameTxt, EmailTxt, MobileTxt .... etc). Also I've placed 1 DataGridView and some Buttons. I also have 1 Module [Module1].

SaveBtn : Save new record to the Advantage Database
SearchBtn : Search for records using by Sname
EditBtn : After search, edits the record
DeleteBtn : After search, deletes the record
CancelBtn : Reset the form and the DataGridView
ExitBtn : Exits the application

In order to use Sybase Advantage Database with Visual Basic 2010 and just like any other Database, you must call the References to the Database :
Visual Basic 2010 - Add Reference to Sybase Advantage Database

The Codes
Module1

Form1
Sub ClearAll()
Private Sub Form_Load()
Private Sub ExitBtn_Click()
Private Sub SaveBtn_Click()
Private Sub SearchBtn_Click()

Private Sub CancelBtn_Click()
Private Sub EditBtn_Click()
Private Sub DeleteBtn_Click()

Note : You will need 2 Pictures PNG [On : Off] to refer to the Database Status, path [..Bin/Debug].

Another Lesson : How to Remote Database using XML :

1) Create an XML file in path [.\bin\Debug\] Folder and call it [XmlFile.xml]
2) Open [XmlFile.xml] with NotePad.exe and paste the following code into it :

3) Save the Xml file.
4) Open our VB 2010 Project and add a ToolStrip to the Form1, Dock = Buttom
ToolStrip VB 2010 Xml Database Update
ToolStrip VB 2010 Xml Database Update
5) How does it work "The Main Idea" : When you want to Alter structure or Edit the Advantage Database of your Advantage Database "DB.Add" on a Client's "User's" computer you will need to do something like what I did, easy and guaranteed. Find a Server and send SQL Statements to the Xml File and when the user checks for update [Check For Update] button, the application will open the XmlFile.xml and execute the Sql-Statement within, simply like that. When you use Version Number along with the update, it makes the Update process so easy to be tracked, so we will need to create and extra Database Table in the Advantage Database and call it [DB_Version].
6) DB_Version table structure :
Update Advantage Database [MyDB.Add] using XML and Visual Basic 2010
Update Advantage Database [MyDB.Add] using XML and Visual Basic 2010
Note : UpdateDT column is Date DataType.
7) Now each time you send updates to XML file, the user Checks for update and choose the XML file from Open Dialog Box and it compares the Date and Version of the Update, if New then it executes the Sql Statement line, if not, then it gives message [MsgTxt.Text] You're Up-To-Date.
8) Download Example from MediaFire.com [Testing.ZIP]

AdsConnection GetSchema tip :

How to retrieve Advantage Data Dictionary Schema in VB 2010.
VB 2010 GetSchema - Retrieve Tables, Columns From Ads Data Dictionary (AdsConnection)

Advantage DataTypes conversion in VB 2010

Type

Length

Available in DBF Table

VB 2010 Value

Character
1 to 65530
Yes
4
CICharacter
1 to 65530
No
20
Date
4
Yes
3
Logical
1
Yes
1
Memo
9
Yes
5
Double
8
VFP, Extended
10
Integer
4
VFP, Extended
11
Numeric
2 to 32
Yes
2
Image
9
Extended
7
Binary
9
Extended
6
ShortInteger
2
No
12
Time
4
No
13
TimeStamp
8
No
14
AutoIncrement
4
No
15
Raw
1 to 65530
No
16
CurDouble
8
No
17
Money
8
No
18
ModTime
8
No
22
RowVersion
8
No
21

Best Use, For example :
When you try to Retrieve Advantage Data Dictionary Table Structure you will get column names, and you will may need to retrieve Data Types [Field_Type], Advantage Data Arc. provides System.Columns Field_Type column within the System.Columns Table that return values like [Character], now when you do that in Visual Basic 2010 or any Visual Basic .Net version, you will not get [Character] but you will get [4] instead and you will want to convert it into [Character] name, you can do that using a function or a Select Case expression in VB 2010.
So, in order to retrieve Field_Type or DataType of a certain column in Advantage Database, you may use this code:

Some Exceptions and Errors noticed :

Error : 
Table doesn't appear in the Data Dictionary [ARC.exe] but though it appears in the Data Dictionary Folder.
Description :
When you try to create a free Table [ADT Table] using Sql Statement from VB 2010 like this. The result will be a free Table but not included in the Data Dictionary, but you will only see it in the Folder contains the Database.
Cause :
The User Id section in the connectionString is Empty, but if you tried to create another table with the same name you will get an Error specifying that ISAM found a table with the same name "Table already exists" though it doesn't appear in the Data Dictionary.
Solution :
Provider a User ID or a User Id and Password if possible in the connectionString Whether you are using OleDBConnection or AdsConnection to work with this Data Dictionary.

Here are some online Visual Basic lessons and courses :

vb.net

OOP Toturial Index Polymorphism VB 2010 VB 2010 Optimization object oriented programming vb.net vb.net OOP Crystal Report Freelance Optimization VB 2010 MS-Access 2003/2007 ADO.Net visual basic course Crystal report and VB .net Earn money programming - Programmer Jobs Online Online courses VB2010 Receive E-mail Search Optimization Sql Server Visual Basic Visual Basic 2010 online courses Visual Basic Job online visual basic courses pop server pop3 visual basic courses online visual basic online courses ADO.Net online mode Insert Date into SqlServer using VB.Net Install Crystal report No error message available SqlServer VB 2010 DataGridView Visual Basic .Net and SQL Server Date-Time Visual Basic .net Visual Basic Class connecting to access database via dao using vb.net. database e-mail .net framework 4.5.2 Activate Visual Studio 2005 Advantage Data Dictionary Advantage Database Visual Basic 2010 Binary Diff Buttons sound in VB 2010 CR for VS2015 CRforVS2015 Check internet connection Command Prompt Communicate with a client Compare two applications Compare two strings and return differences Compare two treeviews Conversion from type 'DBNull' to type 'String' is not valid Crystal Report with Protected MS-Access database DAO + VB .NET + ACCESS DataGridView VB 2010 Programming DataGridView with MS-Access DataReader DevExpress 12.2.9 Serial crack full DevExpress VB.Net DevExpress full Download DevExpress 12 Dxperience 12.2.4 Dxperience full serial crack Event Planning Example on connecting to Advantage Data Dictionary from VB.Net FC Command Fade Image VB 2010 MS Access 2010 MS SQL SERVER 2000 INSTALLATION MS VB.Net MS-Access 2007 2010 MS-Access Compact and Repair from VB 2010 Programmatically Make sure application is running Microsoft Visual Basic .Net Math Functions list OOP Lesson 11 OOP Lesson 12 OOP Lesson 6 OOP Lesson 7 OOP Lesson 8 OOP Lesson 9 OOP Lesson13 OOPTutorials POP3 Commands in VB 2010 Point of sale application Purchase Receive E-mail from Gmail in VB 2010 Requirement Doc Reverse Strings SQL Server 2000 SQL Server 2000 date-time type Sales and Stores application Source code download Sql Server and VB.Net The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine The following control could not be licensed There is already an open DataReader associated with this Command which must be closed first Toolbox items Topmost - Inputbox Sloved Tx TxtControl for Visual Basic Use case definition VB 2005 Activation Code VB 2010 Compare and return differences VB 2010 Create Controls at Run-Time with events VB 2010 How to fade Image VB 2010 Internet VB 2010 Read Text Files VB 2010 Reverse Strings VB 2010 check for internet connection VB 2010 database compact and repair VB 2010 progressbar VB.Net Math functions VB.Net Search Optimization VB.net SqlServer 2000 VB.net lessons VB2010 VS 2051 VS2010 VS2015 VS2017 VS2019 Virus W32.Sality Visual Basic Application Development Visual Basic Virus Visual Studio Serial Number book classes vb compare windows applications and return the difference. crystalDecision older version download crystal report for VB 2010 dtSearch dtSearch Engine dtSearch Engine download full free free make sure application is installed object oriented programming languages oop Lesson 10 play sounds in Visual Basic.net progress bar result code: DB_SEC_E_AUTH_FAILED(0x80040E4D). sqlserver2000 vb.net project (new-save-edit-delete) the application failed to initialize properly 0xc000007b tutorials vb .Net functions list. vb 2010 Create TextBox with events at Project Runtime vb 2010 receive Emails visual basic .Net FlexGrid visual basic courses win10 32 bit solution برنامج المشتريات و المبيعات و المخازن
Show more