473,785 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visual basic 2008 - Fax numbers are stored in database.

1 New Member
I have just finished creating a simple fax program - that can transmit, connect to the SQL DB, and query the customers table. How would I go about looping throught the list of phone numbers to transmit our availability to each customer. We have close to 1000 customer fax numbers after the query. Currently I've exported the list to a spreadsheet for testing.

Our fax server is a windows 2003 server with a rocket port modem and we have four fax lines. I would prefer after the query to transmit the faxes using two phone lines which can be configured on the server.. I would like to transmit the list in order - so a pause would have to be in place and if the distant line is busy to retry two times - then go to the next number. If anyone has any idea's it would greatly be appreciated.


Code:
<
Option Explicit On
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports Microsoft.Offic e.Interop

Public Class frm1
Inherits System.Windows. Forms.Form
'Declare variables for Fax server faxcomex library
Dim objFaxDocument As New FAXCOMEXLib.Fax Document
Dim objFaxServer As New FAXCOMEXLib.Fax Server
Dim JobID As Object
'Dim devices As FAXCOMEXLib.Fax Device



'Declare varibles for DB connection
Dim conn As New ADODB.Connectio n ' This declares the name of the connection
Dim rst As New ADODB.Recordset ' This declares the name of the recordset
Dim sSQL As String ' Variable used to open the recordset
Dim DevNursery As String ' Connection string variable
Dim appExcel As Excel.Applicati on
Dim wbkReport As Excel.Workbook
Dim wksReport As Excel.Worksheet
Dim intField As Integer, intRow As Integer
Dim dbstate As Integer



Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btntransmitt.Cl ick




DevNursery = "Provider=SQLOL EDB;" & _
"DRIVER={SQLSer ver};" & _
"SERVER=Server3 500\NurserySQL; " & _
"DATABASE=DevNu rsery;" & _
"Trusted_Connec tion=yes"




conn.Open(DevNu rsery)

dbstate = conn.State
sSQL = "SELECT SName,SAvailabi lityFax FROM CustomersTbl where StoreNameID=25 and SAvailabilityFa x is not null"
rst.Open(sSQL, conn)
rst.MoveFirst()
If Not rst.EOF Then
Do Until rst.EOF
MessageBox.Show ("First record is: " & rst.Fields.Item ("SName").Value )
rst.MoveNext()
Loop
Else
End If

rst.Close()
conn.Close()
rst = Nothing


objFaxServer.Co nnect("serverfa x") 'Connect to the fax server

objFaxDocument. Body = "\\testPC\c$\te st.txt" 'Document to transmit


objFaxDocument. Recipients.Add( "11111111", "Todd") 'Number to dial for testing




JobID = objFaxDocument. ConnectedSubmit (objFaxServer)

MsgBox("The Job ID is :" & JobID(0))

'Set the cover page type and the path to the cover page
objFaxDocument. CoverPageType = FAXCOMEXLib.FAX _COVERPAGE_TYPE _ENUM.fcptSERVE R

'objFaxDocument .CoverPageType. FAXCOMEXLib.FAX _COVERPAGE_TYPE _ENUM.fcptNONE( )
objFaxDocument. CoverPage = "generic"

'Provide the cover page note
objFaxDocument. Note = "Availabili ty Sheet Nurseries"

'Provide the address for the fax receipt
objFaxDocument. ReceiptAddress = "emailaddre ss"

'Set the receipt type to email

objFaxDocument. ReceiptType = FAXCOMEXLib.FAX _RECEIPT_TYPE_E NUM.frtMAIL


'Set the receipt type to email
objFaxDocument. ReceiptType = FAXCOMEXLib.FAX _RECEIPT_TYPE_E NUM.frtMSGBOX

Exit Sub

End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnclose.Click
Close()
End Sub

Private Sub Label1_Click(By Val sender As System.Object, ByVal e As System.EventArg s)

End Sub

Private Sub frm1_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load

End Sub

Private Sub Button1_Click_1 (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click



DevNursery = "Provider=SQLOL EDB;" & _
"DRIVER={SQLSer ver};" & _
"SERVER=Server3 500\NurserySQL; " & _
"DATABASE=DevNu rsery;" & _
"Trusted_Connec tion=yes"

conn.Open(DevNu rsery)
dbstate = conn.State
sSQL = "SELECT SName,SAvailabi lityFax FROM CustomersTbl where SAvailabilityFa x is not null and SAvailabilityFa x <> '0000000000'"



appExcel = New Excel.Applicati on
appExcel.Visibl e = True
wbkReport = appExcel.Workbo oks.Add
wksReport = wbkReport.Works heets(1)

rst.Open(sSQL, conn)
rst.MoveFirst()

If rst.EOF <> True Then
rst.MoveFirst()
intRow = 1
Do
For intField = 0 To rst.Fields.Coun t - 1
wksReport.Cells (intRow, intField + 1) = rst.Fields(intF ield).Value
'Name of column = .Name
'rst.Fields(int Field).Name & "=" &
Next intField
rst.MoveNext()
intRow = intRow + 1
Loop Until rst.EOF = True
End If
Exit Sub


rst.Close()
conn.Close()
rst = Nothing
End Sub
End Class
>
Nov 11 '08 #1
0 1499

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1472
by: rodneybauer1 | last post by:
hello: thanks in advance for any responses. i dont have a isp at home so have to use public library computer. will check this every couple days though. im using visual basic.Net windows XP with SQL server 2000 .net sdk 1.1 making a web application: I'm using database very similar in design as that of NorthWind sample Since I'm not at home with my program I'm going by memory now..if there's a slight difference in field names etc for...
11
1948
by: Leon | last post by:
I have six textbox controls on my webform that allows the user to enter any numbers from 1 to 25 in any order. However, I would like to sort those numbers from least to greatest before sending them to the database. How can accomplish this task? Thanks!
0
2306
by: AJIT PITALE | last post by:
Hi, I am using Visual Basic 6 as front end and Visual FoxPro as a Database. I am trying to pass a parameter from VB to Visual FoxPro's Stored Procedure. I am getting an error showing "Data type mismatch" My Connection String is :CNN.ConnectionString = "Provider=VFPOLEDB.1;Data Source=P:\pay.dbc;Mode=ReadWrite|Share Deny Write" CNN.Open
0
1780
by: fiona | last post by:
Reading, Berkshire, UK 05 June 2007 - Crainiate Software make details available of the release of Objecto Framework 2.0, an upgrade to their enterprise business component framework, designed to make it easy for programmers to create agile persisted business objects that are reusable, customisable and scalable, without additional developer tools. Objecto uses object persistence and managed database technology to allow developers to...
6
38523
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get through this without much trouble. Programming knowledge is not required. Index What is SQL? Why MySQL? Installing MySQL. Using the MySQL command line interface
5
5632
by: Claudio M. E. Bastos Iorio | last post by:
Hi, anyone using VS2008 (final) on windows Vista? I have a problem. The ASP.NET web site administration tool on any site created by VS2008, running on Vista, is not working as it should. I can configure users, roles, but when I try the option 'Select a single provider for all site management data' AspNetSqlProvider test, I receive the message: 'Could not establish a connection to the database. If you have not yet created the SQL Server...
3
2134
by: Saucer Man | last post by:
Is this only available as part of Visual Studio or can it be purchased separately? -- Thanks!
2
2601
by: mdimitris | last post by:
Goodevening I am new to the community and I would like to post a question. I think the solution is simple I just couldnt find the right one. I want to build a simpe program that will manage an microsoft access database to visual basic 2008. I noticed that there are significant changes to previous versions of visual basic. Anyway, I would like a mdb file connected to my application and the user can change/update etc throught a form. I think I...
5
5312
by: CAM | last post by:
Hello, I am using SQL Server Express 2008 for my database and Visual Studios 2008 - Visual Basic.Net for my forms. I Gone into VS 2008 and specify the source of data using the Data Sources Windows following the wizard. I have input the Server name using Windows Authentication, select the database name and tested the connection it works fine. I created a form in VS 2008 added text boxes and the data navigator, table adapter. It all...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.