|
@@ -4,16 +4,16 @@ uses odbcsql;
|
|
|
|
|
|
|
|
|
|
Const
|
|
Const
|
|
- DBDSn : Pchar = 'FPC';
|
|
|
|
- Empty : pchar = '';
|
|
|
|
- Query : pchar = 'SELECT Id,Username,InstEmail from FPdev Order by UserName';
|
|
|
|
|
|
+ DBDSn : PAnsiChar = 'FPC';
|
|
|
|
+ Empty : PAnsiChar = '';
|
|
|
|
+ Query : PAnsiChar = 'SELECT Id,Username,InstEmail from FPdev Order by UserName';
|
|
// Adapt to needs...
|
|
// Adapt to needs...
|
|
{$ifdef linux}
|
|
{$ifdef linux}
|
|
- UserName : pchar = 'michael'; // for mysql test.
|
|
|
|
- Password : pchar = 'geen';
|
|
|
|
|
|
+ UserName : PAnsiChar = 'michael'; // for mysql test.
|
|
|
|
+ Password : PAnsiChar = 'geen';
|
|
{$else}
|
|
{$else}
|
|
- UserName : pchar = ''; // for MS-Acces test.
|
|
|
|
- Password : pchar = '';
|
|
|
|
|
|
+ UserName : PAnsiChar = ''; // for MS-Acces test.
|
|
|
|
+ Password : PAnsiChar = '';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
Function ODBCSuccess (Res : Integer) : Boolean;
|
|
Function ODBCSuccess (Res : Integer) : Boolean;
|
|
@@ -27,8 +27,8 @@ Var
|
|
DBHandle : SQLHandle;
|
|
DBHandle : SQLHandle;
|
|
StmtHandle : SQLHSTMT;
|
|
StmtHandle : SQLHSTMT;
|
|
ResID : Longint;
|
|
ResID : Longint;
|
|
- ResName : Array[0..255] of char; // Matches length of field+1
|
|
|
|
- ResEmail : Array[0..255] of char;
|
|
|
|
|
|
+ ResName : Array[0..255] of AnsiChar; // Matches length of field+1
|
|
|
|
+ ResEmail : Array[0..255] of AnsiChar;
|
|
|
|
|
|
Procedure FreeHandles;
|
|
Procedure FreeHandles;
|
|
|
|
|
|
@@ -108,7 +108,7 @@ begin
|
|
begin
|
|
begin
|
|
Inc(Count);
|
|
Inc(Count);
|
|
Write('Record: ',Count,' : ');
|
|
Write('Record: ',Count,' : ');
|
|
- Writeln(ResId,' ',PChar(@ResName[0]),' ',Pchar(@ResEmail[0]));
|
|
|
|
|
|
+ Writeln(ResId,' ',PAnsiChar(@ResName[0]),' ',PAnsiChar(@ResEmail[0]));
|
|
Res:=SQLFetch(StmtHandle);
|
|
Res:=SQLFetch(StmtHandle);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|