MS Access
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

MS Access

Started by NeiSep, 11 January, 2004, 16:07:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NeiSep

Is there some one know how to do a script in PtokaX witch can read the register users??
and then put it in a Ms Access i want to know if there is anyway to do this??
<@Localhost Bust your ASS@>

xfernal

I am looking for a similar solution.
See this thread:
http://board.univ-angers.fr/thread.php?threadid=965&boardid=6&styleid=1&sid=64cfccd50c1b5930062663e28a5629df

You might be better off parsing the RegisteredUsers.dat file and importing the data in via a VB Script rather than using LUA. You could even setup a scheduled task to run however often you need to get new users into your database.

xfernal

#2
Here is a VB Script that should work for importing that file into your Acccess database. Make sure you read the comments and change as neccessary. Then schedule you a task to import them into your database. I haven't tested this script but it should work.

Here ya go:

Dim ObjConn, varTextPath, varLine, varUser, varPassword, varTypeUser, varDB
'path to your registeredusers.dat
varTextPath = "d:\whereever\"
'path and name of your database
varDB = "D:\whereever\yourdb.mdb"


Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(varTextPath & "RegisteredUsers.dat"), 1)
'we have opened the file, now we loop through the entire file, line by line
do while f.AtEndOfStream = false
varLine = f.ReadLine
arrLine = Split(varLine, "|")
If UBound(arrLine) = 2 Then
   'if I remember correctly, the first value is the username, second is password, followed by type of user(OP, reg, etc.)
   varUser = arrLine(0)
   'i will not use the 2 values below for this script but you could simply use the values below in your own SQL statement
   varPassword = arrLine(1)
   varTypeUser = arrLine(2)
   'here we are going to make a connection to the db
   SET ObjConn = CreateObject("ADODB.Connection")
   strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & & ";Persist Security Info=False"
   ObjConn.Open  strConnString
   'make sure you rename your table and columns
   strSQLExist = "Select YourColumnNameForUsers FROM YourTable WHERE YourColumnNameForUsers = '" & varUser & "'"
   Set rsUser = ObjConn.Execute(strSQLExist)
   'if the user is NOT already in the databse then we will add it.
   If rsUser.EOF Then
      strSQL = "Insert Into YourTable (YourColumnNameForUsers) VALUES ('" & varUser & "')
      ObjConn.Execute(strSQL)
   End IF
   ObjConn.Close
   Set ObjConn = Nothing
End If
loop
f.Close
Set f=Nothing
Set fs=Nothing

SMF spam blocked by CleanTalk