Hi, I would like to know how to merge 2 daniweb accounts because there was a time I accidentally created a new account (Username: samuel1991) via Facebook which used a slightly different email address (samuel_lee_1991@qq.com) from my main email address (samuel_lee_1991@hotmail.com) used in Daniweb.

TYVM

[QUOTE=Ancient Dragon;1337865]On Windows 7 (and probably Windows Vista too) you will not have permissions to query that database in the the folder. I had to move that file to a different folder that I know I have permissions. When I did that the program worked as expected.

Why you are having so much trouble compiling that simple program is beyond me. Does that project have UNICODE turned on? Check the project settings.

Project --> Properties --> Configuration Properties --> General. Then in the right side of the screen, third item from the botom change Character Set to "Not Set"[/QUOTE]
I am sorry, I could not find the Configuration Properties part and I am wondering why strcpy_s does not works as expected? Does that means this project is not unicode ready.

The attachment provided shows the screenshots I have tried to find the setting while the attachment to both DLL and console applications are as below:
DLL: [URL="

[QUOTE=Ancient Dragon;1337592]You have a lot of syntax errors in your program. Here's the correctins. I added another parameter to that function -- the size of returnbuf. I didn't test it out because I don't have a copy of that database.
[code]

include <iostream>

include "cppSQLite3.h"

include <string>

include <string.h>

using std::string;
using std::cout;
using std::cin;

char GetDirectory(const char Subdomain,const char PCD,char returnbuf,int bufsize);

int main()
{
char InstallPath[255] = {0};
char Subdomain[] = "{A334FDED-DCCA-481E-B226-F902CCC419D2}";
char Path[] = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\pcd.db";
char p = GetDirectory(Subdomain, Path, InstallPath, sizeof(InstallPath));
if( p != NULL)
cout << InstallPath << '\n';
else
cout << "GetDirectory() failed\n";
}
char
GetDirectory(const char Subdomain,const char PCD,char returnbuf,int bufsize)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
db.open(PCD);
CppSQLite3Query q = db.execQuery(command.c_str());
db.close();
const char
p = q.fieldValue(0); //Without the one in bold, error message: error: invalid conversion from 'const char' to 'char' is thrown.
if( p != NULL)
strcpy_s(returnbuf,bufsize,p);
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code][/QUOTE]

Hi, thanks for making the tips clearer, but if I use [code] strcpy_s(returnbuf,bufsize,p);[/code], I get these errors (All in the main.cpp):
38|error: 'strcpy_s' was not declared in this scope|

And if I changed to:[code] strcpy(returnbuf,bufsize,p);[/code], I get these errors (All in the main.cpp):
|In function 'char GetDirectory(const char, const char, char, int)': |
38|error: invalid conversion ...

[QUOTE=Ancient Dragon;1337095]c++ program. Just because a function parameter uses cons doesn't mean the calling function has to declare it as const. All const keyword says is that the function is not going to change its value.

In the VB program you posted you need to allocate memory for InstallPath because the C DLL program is going to try to copy a string to that variable. In the code below I just set the size of that variable to 255 characters, because under MS-Windows that's the longest possible path.
[code]

include <iostream>

char dllspec(dllimport) GetDirectory(const char Subdomain,const char PCD,char returnbuf);

int main()
{
char InstallPath[255] = {0};
char Subdomain[] "{A334FDED-DCCA-481E-B226-F902CCC419D2}"
char Path[] = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\pcd.db"
char* p = GetDirectory(Subdomain, Path, InstallPath);
if( p != NULL)
cout << InstallPath << '\n';
else
cout << "GetDirectory() failed\n";
}
[/code][/QUOTE]

Nope, it still dont work
For a console program, if a wrote
[code]

include <iostream>

include "cppSQLite3.h"

include <string>

int main()
{
char InstallPath[255] = {0};
char Subdomain[] "{A334FDED-DCCA-481E-B226-F902CCC419D2}"
char Path[] = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\pcd.db"
char p = GetDirectory(Subdomain, Path, InstallPath);
if( p != NULL)
cout << InstallPath << '\n';
else
cout << "GetDirectory() failed\n";
}
char
GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
db.open(PCD);
CppSQLite3Query q = db.execQuery(command.c_str());
db.close();
const char
p ...

[QUOTE=HansomePrincess;1336926]pls help me to my project....

i need codes for Saving data in the data grid....[/QUOTE]
It has nothing to do with your installer.

Datagrid? Ur details is too vague that no one can help you.

[QUOTE=Ancient Dragon;1336947]What is being passed in as the parameters to that function?

One ways to debug it is to put that function in a simple c++ console program and run it without the DLL. Once you have the function working correctly you can put it into a DLL and call it from the installer.[/QUOTE]
3 parameters (I tested from both installer, which is using pascal script --- inno setup and again, VB.net)

For VB.net test app one, the code involved is:
[code=vb.net]
//'During load time
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim InstallPath As Char() = Nothing
Dim Subdomain As Char() = "{A334FDED-DCCA-481E-B226-F902CCC419D2}"
Dim Path As Char() = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\pcd.db"
InstallPath = GetDirectory(Subdomain, Path, InstallPath)
MessageBox.Show(InstallPath)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

    Application.Exit()
End Sub

<DllImport("GetPCD.DLL", CallingConvention:=CallingConvention.StdCall)>
Public Shared Function GetDirectory(ByVal SubDomain As Char(), ByVal PCD As Char(), ByVal returnbuf As Char())

As Char()
' Leave the body of the function empty.
End Function
[/code]

There is no missing file issues but rather some odd messages like: Unable to marshal "return value": Invalid managed, unmanaged type combination.

For Pascal script, the code involved was: (Note that green part are non-essenital codes pertaining to this issue, and that are proven to be working codes while the red ones might be problematic / the code involved is related to this question.
[code]
//"Public variable" location
const MB_ICONINFORMATION = $40;
var
function GetDirectory(SubDomain: String;PCD:String;returnbuf: array of string): String;
external 'GetDirectory@files:GetPCD.dll ...

[QUOTE=Ancient Dragon;1336631]>>//Somehow referenced from the site as most of the source are showing cout and I am not sure whats that. (

No wonder you are having so much trouble, you have not the slightest idea of what you are doing. Anyone with a week's worth of c++ training would know what cout is.

returnbuf = q.fieldValue(0);//
Wrong. wrong. wrong.

[code]
char p = q..fieldValue(0);
if( p != NULL)
strcpy(returnbuf,p);
[/code][/QUOTE]
Oddly, only when I have this function, it allows me to compile
[code]
char
DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
db.open(PCD);
CppSQLite3Query q = db.execQuery(command.c_str());
db.close();
[B]const[/B] char
p = q.fieldValue(0); //Without the one in bold, error message: [I]error: invalid conversion from 'const char' to 'char'[/I] is thrown.
if( p != NULL)
strcpy(returnbuf,p);
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code]
I know the double dot looks a typo, on top of that there is no more issues except that for some reason, while it has successfully compiled, it seemed to be throwing errors during runtime (Failed to get correct directory) Could this be the above code is wrong or something to do with my main application code, which is not intended to write in C++ but to be deployed in an installer. (Details of it would be ...

[QUOTE=Ancient Dragon;1336397]Look at that CppSqlIite project and header file. execScalar() returns an int, not a string. Therefore strcpy() will not work. Read [URL="

I still got error:
.cpp file:
[code]
char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
db.open(PCD);
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
[I] strcpy(returnbuf,db.execScalar(command.c_str()));[/I]
db.close();
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code]
.h file:
[code]

ifndef __MAIN_H__

define __MAIN_H__

include <windows.h>

include <string>

include <sstream>

/* To use this exported function of dll, include this header

  • in your project.
    */

    define DLL_EXPORT __declspec(dllexport)

ifdef __cplusplus

extern "C"
{

endif

char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD, [I]char iobuf[/I]);

ifdef __cplusplus

}

endif

endif // __MAIN_H__

[/code]

The italics are ones that are edited to.

By the way, is there any thing to do with the dependent (CppSqlite3) where I just simply CppSQLite3.cpp, CppSQLite3.h, sqlite3.def,sqlite3.h,sqlite3.lib on to the project directory?

This time round, the error is:
[B]error: invalid conversion from 'int' to 'const char'|
[/B]
And
[B]error: initializing argument 2 of 'char
strcpy(char, const char)'|[/B]

Both are the line of
[code]
strcpy(returnbuf,db.execScalar(command.c_str()));
[/code]

If I commented that out, the error becomes:

obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to sqlite3_close'| obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference tosqlite3_free_table'|
obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to sqlite3_column_count'| obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference tosqlite3_column_count'|
obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to sqlite3_free'| obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference tosqlite3_vmprintf'|
obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to sqlite3_free'| obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference tosqlite3_free'|
obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to sqlite3_free'| obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference tosqlite3_mprintf'|
obj\Release\CppSQLite3.o:CppSQLite3.cpp|| undefined reference to ...

[QUOTE=cguan_77;1335150]hi samuel, thanks for the reply. but the underlie code below it shows, end of statement expected. any thing i'm missing. Thanks.

public static void [U]Send(String from, String to, String subject, String messageText).[/U][/QUOTE]
This is not C# or C++. This is VB.

you try public sub then the underlined ones, followed by end sub (Your code should between [B]public sub[/B] and [B]end sub[/B])

commented: thank you :) +0

[QUOTE=Ancient Dragon;1334643]On which line did that error occur? Your compiler should have told you.

Is Subdomain an integer? I thought it was a string or chracter array.

Did you include <string> header file?[/QUOTE]
Subdomain is not an integer as it must have a {,},- as well as alphabets from A to F (Hex value).

My project did not find any "int" keyword.

Also, the compiler says this error on the line
[code]
returnbuf = db.execScalar(command.c_str());
[/code]

while I have these declarations
[code]

include "main.h"

include "cppSQLite3.h"

include <iostream>

include <string>

[/code]

And the entire function for this
[code]
// a sample exported function
char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
db.open(PCD);
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
[I] returnbuf = db.execScalar(command.c_str());[/I] //Error occurred here
db.close();
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code]
Hence, the entire cpp file goes
[code]

include "main.h"

include "cppSQLite3.h"

include <iostream>

include <string>

// a sample exported function
char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
db.open(PCD);
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
[I] returnbuf = db.execScalar(command.c_str());[/I] //Error occurred here
db.close();
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
} ...

look, it might be tiring to just read the codes as I am too used to IDE.

Who ask you to save into 2 databases?

I mean, you should use only 1 command and 2 connections pre-defined, such that you change the command.connectionstring just before you open your database. Will that help?

Form 1
[code]
Public Shared Visaconn As New oleConnection
Public Shared Masterconn As New oleConnection

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
VisaConn.ConnectionString = ""'Connection String to Visa DB
MasterConn.ConnectionString = ""'Connection String to Masters DB
End Sub
[/code]

If on same form, then on the subroutine (Sub) that opens, insert and / or update database
[code]
Dim command As New oleCommand
Dim hereconn As New oleConnection
If PM = "Visa" Then
command.conn = VisaConn
hereconn = Visaconn 'Public variable are meant to be the same template pre-defined in startup. Use local variable for local business only.
ElseIf PM = "Masters" Then
command.conn = MasterConn
hereconn = MasterConn
Else
'Up to you to decide
End If
command.commandtext = ""'Put your own update query string
hereconn.open()
command.executenonquery()
hereconn.close()
End Sub
[/code]

Notes: If this updating of query is done on ANOTHER form, then please replace to
[code]
If PM = "Visa" Then
command.conn = [B]Form1.[/B]VisaConn
hereconn = [B]Form1.[/B]Visaconn 'Public variable are meant to be the same template pre-defined in startup. Use local variable for local business only.
ElseIf PM = "Masters" Then
command.conn = [B]Form1.[/B]MasterConn
hereconn = [B]Form1.[/B]MasterConn
Else
'Up to you to decide ...

[QUOTE=Ancient Dragon;1334609]line 8: This is not vb, -- its c++ and you can not concantinate strings like that
[code]
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
returnbuf = db.execScalar(command.c_str());
[/code][/QUOTE]
Thanks for the clarification, however when I changed the code to (The entire function is shown):

[code]
char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
db.open(PCD);
[B]std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
returnbuf = db.execScalar(command.c_str());
[/B] db.close();
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code]

It give me this new error:
error: invalid conversion from 'int' to 'char*'|

Problem is, I did not see any integer being declared, so what had went wrong for now?

Thanks a lot...

[QUOTE=Simply Me;1334352]I'm sorry, I forgot to tell...I am using vb2005.[/QUOTE]
Facepalm. Nevermind, the rdlc should not be a big issue, as a text file or even executables can have weird extensions. (Certain "dlls" are supposed to be dlls, but they have a special extension file. Look for After Effects plugin the .AEX ones and you know what I meant.)

Well, then as I suggested:

Step 1: Get each grade from DB

Step 2: Get the details, IF the grade does not required to be calculated on the fly due to weightage issue, just add into the arraylist

Step 2a: If that grade has to be calculated on the fly, then calculate it on the fly, THEN add into the arraylist.

Step 3: Use the For Loop I have given on the first reply to get the final result.

[QUOTE=Simply Me;1334344]some the of grades are stored in the database but others are computed on the fly...What I mean say for example the TLE and Computer subjects...the individual grades for TLE and Computer are in the database but I need to get 70% and 30% respectively to come up with the correct grade so i compute it on the fly...I understood your code but I need this to be .rdlc file...if then is not supported their I think.[/QUOTE]
It has nothing much to do with rdlc file (Without providing which software you used, nobody can help you much) and it has nothing much on database / on the fly issue as I can always get the 2 subject's result and calculate [B]first[/B] B4 adding to this arraylist OR I can also use some mathematical operations in database (Out of this scope) so that whenever the DB is returned, it has considered the 70% & 30% weightage issue and using that value to store in the arraylist, followed by using the above method.

It might have to do with your database design. You can always put a few columns in a table as "unique", like "VoterID","CandidateID" as unique, so that the Candidate of an area / a post can receive many votes from many voters (Because a voter 1 votes for Candidate A and Voter 2 votes for Candidate A is still considered unique. At the same time, for a priority based voting or whatever is called when voters are asked to select the candidate by preference 1 to X, you should put a Preference number as unique instead of Candidate so that Voter A votes for Candidate A as First choice and Voter A votes for Candidate B as second choice are considered as unique.)

Being unique is not always necessary to be primary key, but primary key requires to be unique.

Back to your question, you meant on exact address being duplicated (Like 2 address of: Block 1, Unit 1 which should not be the case, but Block 1, Unit 2 is allowed), then you should put the Address to be unique as well (Because 2 primary keys = when one of the 2 values are different, the address record will be allowed to be duplicated as quoted example on top). By the way, I dont think you should do this approach as one can have many eligible voters living in the same address. (Read: A married couple living in the same address, where both have the rights to vote.)

Are they stored in Database? By the way, if all subjects are more than 90, then the average must be more than 90. So, you might as well as checking for each grade's subject, something like:
[code]
Dim Marks As Integer = 100
For i As integer = 0 To alSubject.Count -1
If Marks >= alSubject.Item(i)
Marks = alSubject.Item(i) 'Always get the lowest value, so that by knowing that any subject is 84 or below, it can exit this loop as this student will get no Honor / Fourth Honor etc.
End If
If Marks <=84 Then
Exit For
End If
Next
If Marks >= 85 and < 88 Then
'Result is 3rd Honor
ElseIf Marks >= 88 and < 90 Then
'Result is 2nd Honor
ElseIf Marks >= 90 Then
'Result is 1st Honor
End If
[/code]

I know this is per student way of doing. But this is just an idea to get started.

VB.NET has nothing to do with installer.

You can choose which installer you like such as:
NSIS (Public Domain) -- EXE installer
Inno Setup (Freeware, but not public domain) -- EXE installer
InstallShield (Commerical) -- MSI installer

---- and many others paid solutions as well

You have to decide which installer you would like to use, apart of licensing issue, you need to consider their scripting language (Inno Setup uses Pascal scripting and written in Delphi) as well as their ease to use. (While InstallShield has a big "IDE" like and many things are done in GUI, Inno Setup and NSIS are not. However, Inno has certain add-ons including but not limited to ISTool, which is essentially a Graphical way to build a basic installer.)

Oh yeah, MSI installers are generally in Unicode, so that in different encoding systems [Think a Czech program used in say Japan], that will not show a "rubbish" (Not readable by humans) message. However, NSIS and Inno might not be the case [as in default]. (They have a Unicode version in a year or 2 ago, but it supports only Windows 2000 or above --- anyway below 2000 are too legacy + they are not Unicode system, so forget about them.)

["Bonus tip"]:
MSI ones are generally larger than Inno / NSIS ones as it does not use 7Zip compression (I think only zip for MSI) and the InstallShield thing is generally a big monster that results in its product [Read: Installer you have created] ...

Hi everyone, especially thanks to AD, I hope this would be the last question pertaining to this thread, but when I do this code:
[code]
char DLL_EXPORT GetDirectory(const char Subdomain,const char PCD,char returnbuf)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
db.open(PCD);
returnbuf = db.execScalar("select value From domain_data where SubDomain = '" & Subdomain &"' And key = 'AMTConfigPath';");
db.close();
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
[/code]
The code::blocks showed this error message:
error: invalid operands of types 'const char [50]' and 'const char*' to binary 'operator&'
And by the way, I have decided that since I am a novice or rather, no experience in C++, I would rather add another parameter and it is up to my installer to input this directory instead might be an easier option, and hence I have added a new parameter named as [i]PCD[/i].

Any ideas on what I have done wrong and what should be done in order to have the char array to get the return value from Sqlite? Thanks a lot! (By the way, the query string is correct, as in extracted from the previous VB.NET code.)

[QUOTE=Fbody;1333672]They are already returning a pointer, that's why there is an issue. You can't return a pointer to a local variable, which "buffer" is. This doesn't work because the local object/variable gets destroyed when it goes out of scope at the end of the function. Because the object gets destroyed, the returned pointer is a "dangling pointer", which can be extremely dangerous.

Hence, the reason AD suggested simply returning a bool and using a pointer parameter (char *returnbuf) to get the necessary value back from the function.[/QUOTE]
I see, thanks for the clarification on the warning issues, but I would also like to know how to get 32bit Program Files in C++ in order to establish a connection string as well. Thanks a lot.

[QUOTE=caged_fire;1333661]The warning seems accurate. I don't think you can simply return an array because what you are doing is (as the warning states) returning the address of buffer. You should perhaps try returning an array pointer?[/QUOTE]
I see, as I [code]return returnbuf[/code] from the function will have no issues at all, except I was confused on the declaring of a 255 char long array.

[QUOTE=swathys;1332357]hi,

Does anyone knows on how to update records from 1 text file into 2 different sql database.

Name of the sql Table is Payment2SQL_Success_P() & Payment2SQL_Success_E()
is the code below is on the right track.

[CODE=vb.net] Select Case "AGENCIES"
Case AGENCY_AV Or AGENCY_SR Or AGENCY_IP Or AGENCY_TM Or AGENCY_MS
PBillPayment = True
EBillPayment = False
Case AGENCY_AS Or AGENCY_CM
PBillPayment = False
EBillPayment = True
End Select

    If blnPaymentDone = True Then
        If PBillPayment = True Then
            Payment2SQL_Success_P()
        ElseIf EBillPayment = True Then
            Payment2SQL_Success_E()
        End If
    End If[/CODE][/QUOTE] 

By the way, if you meant one database (As in the database is in the same computer and same directory, but different table) then all you need to do is change the update query only. Thats all.

Ok, your code has nothing to do with updating records into 2 different database.

What I would like to know is:
A: Update a record into 2 different database, because the other one is essentially a backup database.
B: Update a record into only 1 database, but there are 2 different database depending on conditions. (As above u got a condition statement)
Example: A credit card payment software will have to update transaction records in Visa database and not Amex etc database, if the customer is paying by Visa. (I know it might not be happening in real world credit card processing software, but basically you got what I mean)

If what you meant is lateral, you may use a general Public Shared connection & commandtext like this
[code]
Public Shared conn As New connection 'Replace with OleConnection for Access and SqlConnection for SQL Database
Public Shared command As New Command 'Replace with OleCommand for Access and SqlCommand for SQL Database
[/code]
And on Payment2SQL_Success_P() and Payment2SQL_Success_E() (Do both times)
[code]
'Constructor etc declaration are omitted for clarity
conn.connectionstring = "Data Source='" & pathToYourDatabaseVariable & "'"'Define your own connection string here.
command.connection = conn
command.commandtext ="update " 'Write your own database update query
conn.open()
command.executeNonQuery()
conn.close()
[/code]

Of course, if that particular function does only updating of query and does not have other special code / function / things to do, then the above code will have 1 duplicate (The essential difference is the Connection String, thats all.)
Hence, for ...

[QUOTE=Ancient Dragon;1332518]What you want is a character array [icode]char buffer[255];[/icode] That declares an array of 255 characters. c++ also has a std::string class, but you can not use that with SqLite database.

You have to be careful about allocating new memory in a DLL. Memory allocated in a dll with new or malloc() must also be destroyed in that same dll. (std::string allocates memory like that) So you would need to declare that function like this:
[icode]char DLL_EXPORT GetDirectory(const char Subdomain, char* returnbuf)[/icode] where returnbuf (or whatever you want to call it) is a character array allocated by the calling function and used by GetDirectory() to store the string it needs to return. The return value of that function is just returnbuf, or NULL if an error occurs. You could also make the return value just a bool, indicating either success or failure.[/QUOTE]
Thanks for the tip, but I would like to know how to get program files (32bit one even on 64bit OS) directory on C++. Thanks a lot as that will be used for the database directory as well (If it is possible, avoid the need of passing parameters as it is on a fixed location, at Program Files\Common Files\Adobe\Adobe PCD\pcd.db. The Program Files is indeed a (x86) one for 64bit OS case.

By the way, I still dont get the part on [code], char* returnbuf[/code], as it sounded requiring 2 parameters (Correct me if I am mistaken, my apologies) which is not supposed to be the case ...

Ever since the "disatrous" Adobe Encore (CS4 and 5 does not matter)'s way of storing the installation directory details in Sqlite database file and some uninstall string in the registry, I would like to create dll to get the install directory from Sqlite database as per recommended by the Inno Setup (I can only use that to create some language pack installer for now.) users ([URL="

[quote]
after i insert records. I explain, i have form in which user add data into database ACCESS, after that if he would like to view all data he got it but without the latest added, so i was obliged to close application and reopen it, this is not useful
[/quote]You have mentioned that your user had insert records. Then, to only way is to use the function that gets the data again.

Lets say you start a program and automatically it shows the current data in Access, this getting the current data should be named as "Function A" (Actually for easy reference, you should call it GetData or whatever you deem appropirate).

Then your user went to insert / update records. This insert / update record has to be done in some other functions / subroutine in your code.

So now you have updated the database, but you cannot see the updated result, because the retrieved datagridview etc data controls is not synchronize with Access (Or your database such as SQL, for other's benefit.)

Hence, you should call that "Function A" you have loaded during the start of your application. In the case where you have put this section on Load Event / Public Sub New() part, you should extract this getting database's details onto another subroutine / function depending if that returns a value (Again, it is up to your preference, you may update your datagridview etc data controls within the subroutine, or return as a new dataset ...

Before I forget, the code
code[/code], is actually says the char ";" without the quotes only. Thats all. I pick it from somewhere else as well.

[QUOTE=swathys;1331480]hi samuel,

1 last question. I still got an error on (";"c)
[COLOR="red"]Bounds can be specified only for the top-level array when initializing an array of arrays.[/COLOR]

(";"c) - wat is c for

please help
THANK YOU[/QUOTE]
I can only say that, please check your text file again. Check that the number of ";" is the same as in the line.

Example: I had did a test on this code on a file with things like empty space with the records of :

1: [b]1;East Coast;12[/b]
2: [b]2;West Coast;13[/b]
3: [b]3;North Point;14[/b]
for KioskID, KioskLocation, TransactionNo respectively (I know that there are many details as well, but for simplicity sake, I have omitted them.)

The file content is as of follows:
1;East Coast;12
2;West Coast;13

3;North Point;14

, it will generate an error of array out of bounds issue.

No, I did not ask you to create a multi-dimensional array / arraylist as I am not familiar with that as well.

Hi, as I am using Inno Setup to do the installer job, which requires a dll to check for installation path (Please refer to a previous thread: [URL="

I am afraid that, you have to call that function / subroutine for database thing again.