Ordner erstellen & UNIQUE Befehl in Mysql
-
Weiß keiner woran es liegt???
Und was ordner erstellen angeht, weiß auch keiner???MfG
Samuel
-
Platform SDK: Files and I/O
CreateDirectory
The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory.To specify a template directory, use the CreateDirectoryEx function.
BOOL CreateDirectory(
LPCTSTR lpPathName, // directory name
LPSECURITY_ATTRIBUTES lpSecurityAttributes // SD
);
Parameters
lpPathName
[in] Pointer to a null-terminated string that specifies the path of the directory to be created.
There is a default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths.Windows NT/2000: An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of CreateDirectory and prepending "\?\" to the path. The "\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with CreateDirectoryW. However, each component in the path cannot be more than MAX_PATH characters long. This also works with UNC names. The "\?\" is ignored as part of the path. For example, "\?\C:\myworld\private" is seen as "C:\myworld\private", and "\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".
lpSecurityAttributes
Windows NT/2000: [in] Pointer to a SECURITY_ATTRIBUTES structure. The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory. If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The target file system must support security on files and directories for this parameter to have an effect.
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Some file systems, such as NTFS, support compression or encryption for individual files and directories. On volumes formatted for such a file system, a new directory inherits the compression and encryption attributes of its parent directory.Windows NT/2000: An application can obtain a handle to a directory by calling CreateFile with the FILE_FLAG_BACKUP_SEMANTICS flag set. For a code example, see CreateFile.
MAPI: For more information, see Syntax and Limitations for Win32 Functions Useful in MAPI Development.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h; include windows.h.
Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.See Also
File I/O Overview, File I/O Functions, CreateDirectoryEx, CreateFile, RemoveDirectory, SECURITY_ATTRIBUTESBuilt on Monday, August 16, 1999Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h; include windows.h.
Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
See Also
File I/O Overview, File I/O Functions, CreateDirectoryEx, CreateFile, RemoveDirectory, SECURITY_ATTRIBUTES
-
Danke schon mal... Die erste Frage ist wohl erledigt...
Ja, ja MSDN!!! Peinlich, peinlich dass ich es nicht gefunden habe!!!
-
Am Anfang habe ich in der MSDN auch nichts gefunden. Irgendwie gewöhnungsbedürftig das Ding.
-
Mit den Querys passt immer noch nicht. Ich weiß nicht was ich noch machen soll...
Vielen Dank für eure Geduld...
-
ALTER TABLE ct_arten ADD UNIQUE ('code')
-
Danke Unix-TOM aber irgendwie will nicht...

Ich habe mit folgendes versucht,if (mysql_query(&mDB,"ALTER TABLE ct_arten ADD UNIQUE ('code')") != NULL) AfxMessageBox(mysql_error(&mDB));aber irgendwie meckert er ein fehler neben
'code)'...
Ich weiß auch nicht weiter!!!
Das was ich drüber schreibe funktioniert (da wird die tabelle erzeugt)!!!
-
Gib mal her was mysql_error() dazu sagt
-
Danke Unix-Tom für deine Unterstützung...
Ich bin leider nicht mehr auf der Arbeit, kann dir deshalb nicht mehr genau sagen was mysql_error sagt...
Aber wenn ich mich recht erinnere kommt sowas in der Art wie "SQL Syntax Fehler neben 'code')". Nur was ist falsch neben "'code')" ???
Was näheres kann ich dir am Montag sagen...
Danke schon mal im voraus...P.S. Warum ist dein Nickname Unix-Tom? Benutzt du irgendeine Unix System? Free-BSD, Open-BSD, Mac vielleicht?
-
Begonnen mit SCO-UNIX. Jetzt Linux
-
So, nun bin ich wieder auf der Arbeit und die Fehlermeldung von mysql_error lautet:
"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''code')' at line 1".Die Datenbank Version ist die 4.0 und mysql++ API version ist die 1.7.9...
Schon mal dankeschön für eure Mühe...
-
Weiß wirklich keiner was ich da falsch mache???
Ich komme irgendwie nicht weiter und ich brauche es dringend... Ich kann nichts falsches an mein SQL Anweisung feststellen...
-
Hallo,
eigentlich hast du mit so vielen Versuchen schon einen Syntax-Fehler bekommen, so daß ich mich frage, warum du nicht die MySQL-Syntax für den "ALTER TABLE"-Befehl nachliest:
http://www.mysql.de/doc/de/ALTER_TABLE.html
Wenn du das jetzt genau ansiehst, müßtest du deine bisherigen Versuche klar als Syntax-Fehler erkennen, oder du hast Probleme, die Beschreibung dort zu lesen. Ich würde aufgrund der Beschreibung nur dieses
ALTER TABLE ct_arten ADD UNIQUE (code);
probieren (ohne irgendwelche komischen Hochkommas um den Spaltennamen, aber gut, beim letzten Versuch warst du schon nah dran)! und was kommt dabei heraus (jetzt bin ich gespannt
)?MfG
-
Manchmal ist man einfach zu doof...
Danke, endlich hat es funktioniert...