| |
|
|
Christof Neuß | Hi,
time again a Question SQL with of/ one Access-data base in the background. i want simply The boxes UND DEREN ART of/ one designed scheduler inquire.
In VBA does it well so:
How can I the because translate? or knows someone another Possibility? |
|
|
| |
|
|
|
| I at least have of Access-Databases and VBA no idea. ^^ |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | I bin's time again
window 600,600
def %SQL_HANDLE_STMT 3
def %SQL_NTS -3
var File$="D:\Archive\Settings\Alcatel 701\Message.mdb"
var name$="Inbox"
var Init$="Driver={Microsoft Access coachman (*.mdb)};Dbq="+File$
var Command$="SELECT TOP 1 * FROM "+name$
db("SQLInit",Init$)
declare Handle&
external("odbc32.dll","SQLAllocHandle",%SQL_HANDLE_STMT,&SQLDBC,addr(Handle&))
external("odbc32.dll","SQLExecDirect",Handle&,Command$,%SQL_NTS)
declare Count&
external("odbc32.dll","SQLNumResultCols",Handle&,addr(Count&))'--amount boxes
declare Text#:dim Text#,255
declare a&,b&,c&,d&,e&
whileloop 1,Count&
cls
external("odbc32.dll","SQLDescribeCol",Handle&,&loop,Text#,255,addr(a&),addr(b&),addr(c&),addr(d&),addr(e&))
external("oleaut32.dll","VarI4FromI2",b&,addr(b&))'--Conversion of SHORT to LONG
print "Index ",&loop
print "Name ",string $(Text#,0)
print "NameLength ",a&
print "DataType ",b&
print "ColumnSize ",c&
print "DecimalDigits ",d&
print "Nullable ",e&
print
print "<ENTER>"
waitkey
endwhile
print "Fertig"
external("odbc32.dll","SQLFreeHandle",%SQL_HANDLE_STMT,Handle&)
db("SQLDone")
dispose Text#
waitkey
end
'
'Info:
'DataType is of type SQLSMALLINT
'with negativen Values becomes therefore at Reading the omen-bit not correctly umgesetzt!
'Conversion of SHORT to LONG is necessary!
SQL_UNKNOWN_TYPE =0;
SQL_CHAR =1;
SQL_NUMERIC =2;
SQL_DECIMAL =3;
SQL_INTEGER =4;
SQL_SMALLINT =5;
SQL_FLOAT =6;
SQL_REAL =7;
SQL_DOUBLE =8;
SQL_DATETIME =9;
SQL_TIME =10;
SQL_TIMESTAMP =11;
SQL_VARCHAR =12;
SQL_LONGVARCHAR =(-1);
SQL_BINARY =(-2);
SQL_VARBINARY =(-3);
SQL_LONGVARBINARY =(-4);
SQL_BIGINT =(-5);
SQL_TINYINT =(-6);
SQL_BIT =(-7);
window 600,600
$H windows.ph
$H ocx3a.ph
$I ocx3a.inc
ocxInit()
var File$="D:\Archive\Settings\Alcatel 701\Message.mdb"
var name$="Inbox"
var Connect$="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+File$
var Command$="Select TOP 1 * from "+name$
var Rec&=ocxCreate("ADODB.Recordset")
ocxMethod(Rec&,"Open",Command$,Connect$)
var Fields&=ocxget(Rec&,"Fields")'---"Fields" without Parameter: Fields-Collection
var Count%=ocxGet(Fields&,"Count")'--amount boxes in Collection
ocxRelease(Fields&)
declare Feld&
whileloop 0,Count%-1
cls
Feld&=ocxGet(Rec&,"Fields",&loop)'--"Fields" with Parameter: single boxes to 0-index
print "Index : ",&loop
print "Name : ",ocxGet(Feld&,"Name")
print "Type : ",ocxGet(Feld&,"Type")
print "Value : ",left$(ocxGet(Feld&,"Value"),40)'--Content on 40 characters gekürzt
print "DefinedSize: ",ocxGet(Feld&,"DefinedSize")'------declared Size
print "ActualSize : ",ocxGet(Feld&,"ActualSize")'-------used Size
print
print "<ENTER>"
ocxRelease(Feld&)
waitkey
endwhile
ocxMethod(Rec&,"Close")
ocxRelease(Rec&)
ocxDeInit()
print "Fertig"
waitkey
end
'values for DataTypen with MSDN under
'https://msdn.microsoft.com/en-us/library/windows/desktop/ms675318(v=VS.85).aspx
Offtopic @ iF: Leerzeilen in the View source wären helpful
HTH Pascal |
|
|
| |
|
|
|
Christof Neuß | and again be I through you a step moreover.
THANK YOU!!!! |
|
|
| |
|
|
|
| |
|
| |
|
|
|
Nico Madysa | [OFFTOPIC] Lines, not characters, iF. declare zwischendiesenzeilen%
print "gibt it none stood off!"
[/OFFTOPIC] |
|
|
| |
|
|
|
| Oh! Yes, naturally -
Source go Yes gezeilt ^^ -
building I again Flag for a.
there's (but) too whom Quelltextmerker if one 1:1-Source need: [...] |
|
|
| |
|
|