- Connection from Word
- For the connection you have to register an
odbc-entry and you have to install Microsoft Query, which is part of a
full-installation of the office-paket.
- From Word you just may select columns where no
NULL-values exist and joins are often a problem.
- Create a new document
- Click on Tools (Extras) and on Mail Merge
(Seriendruck)
- Choose a document-format like a form-letters
(Serienbriefe)
- Click on new document
- Press the second button and click on "Create
data source" or "Open data source"
- Press the button "MS Query"
- Now you have to choose your odbc-entry
- Enter you userid and password. If there is no
passwort type a space
- Select a database-table
- the rest is easy for a Power++ developer :-)
- Connection from Excel
- You need Microsoft Query; NULL-values are no
problem
- Create a new sheet
- Click on Data (Daten), "Get External Data"
(Externe Daten) and "create new query" (Neue Abfrage
erstellen)
- Choose the TabPage Database and select the
odbc-entry
- Select your columns
- enjoy the data-transfer....
- Connection from Access
- From Access there are no data transfered but it
is allowed to create a table-link in access. After that you can select a
sybase table in the same way as a access-table.
- Create a new database
- Click on File (Datei), "Get External Data"
(Externe Daten) and Import (Importieren)
- Choose from the file-type list the entry
ODBC-Datase
- Choose your ODBC-entry
- Import your wanted tables
- WString GetDBText( WString orginal )
{
WString ret_stringchar quote_string[5];
quote_string[0]= '\\';
quote_string[1] = 'x';
quote_string[2] = (('\\' & 0xF0) >> 4) > 9 ?
(('\\' & 0xF0) >> 4) - 10 + 'A' : (('\\' & 0xF0) >>
4) + '0';
quote_string[3] = ('\\' & 0x0F) > 9 ? ('\\' &
0x0F) - 10 + 'A' : ('\\' & 0x0F) + '0';
quote_string[4] = '\0';
ret_string = StringReplace( text, "\\",
quote_string );
quote_string[2] = (('\'' & 0xF0) >> 4) > 9 ?
(('\'' & 0xF0) >> 4) - 10 + 'A' : (('\'' & 0xF0) >>
4) + '0';
quote_string[3] = ('\'' & 0x0F) > 9 ? ('\'' &
0x0F) - 10 + 'A' : ('\'' & 0x0F) + '0';
ret_string = StringReplace( ret_string, "\'",
quote_string );
return ret_string;
}
- Usage
WString query; //The quote is converted!!
query.Sprintf("insert into table (column1, column2) ('%s', '%s')",
GetDBText("Tom's brother").GetText(), GetDBText ("abc'def''ghi").GetText()
);
query_1->Execute( query );
Here you can download a sample
project, using this code
Remember, this web site is here for you and people
like you. So if you have anything that others might find useful,
let me know, and I'll post it here. E-mail me, Andre Schild at
a.schild(at)aarboard.ch, or fill
out the form at the bottom of the main
page.
Hope to hear from you soon!
Back
to Absolute Power++.